views:

25

answers:

1

Hi everybody. 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.

A: 
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.

Amorya
Hmm. I tried that and it didn't work when I tried to use a GrayScale colorspace.
Alex Zielenski