I'm loading CMYK jpeg image to NSImage, How can i extract c,m,y,k values for a specific pixel ? How can i get byte array with all the CMYK pixel data.. in RGB images i'm using .bitmapData but it seems for CMYK images it is all 0xff.
I have tried converting the NSImage to RGB color-space but i didn't like the results.. and i actually want the c,m,y,k values and not the equivalent rgb values
NSImage *image = [[NSImage alloc] initWithContentsOfFile:inputImageString];
NSBitmapImageRep* rep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]];
bool isCMYK = [rep.colorSpaceName isEqualToString: NSDeviceCMYKColorSpace];
const unsigned char *bytes = rep.bitmapData;
// all values at bytes are not weird and does not represent CMYK values
p.s i can't use core graphics since this cocoa code is compiled using GNUStep.
I did not test this, but does this code return the right values?
This should be a good starting point if it gives you want you want.