Alex Zielenski Alex Zielenski - 4 years ago 178
Objective-C Question

Changing the Color Space of NSImage

Is there a way I can change the color space of an NSimage or NSBitmapImageRep/CGimage or the like. I am open to any way. Preferably the way photoshop does it.

Answer Source
CGImageRef CGImageCreateCopyWithColorSpace (
   CGImageRef image,
   CGColorSpaceRef colorspace
);

To get a CGColorSpaceRef, you can do things like

CGColorSpaceRef CGColorSpaceCreateDeviceRGB();

OR see this page for how to create other color spaces.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download