Without seeing your code, it's hard to understand what is going wrong.
You can draw the image on NSBitmapImageRep using the initWithData: and pass the image to TIFFRepresentation .
Then you can get the pixel value using the colorAtX:y: method, which is the NSBitmapImageRep method, not NSImage :
NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithData:[yourImage TIFFRepresentation]]; NSSize imageSize = [yourImage size]; CGFloat y = imageSize.height - 100.0; NSColor* color = [imageRep colorAtX:100.0 y:y]; [imageRep release];
Note that you must make the setting for the y value because the colorAtX:y method uses the coordinate system that starts in the upper left corner of the image, while the NSImage coordinate NSImage starts in the lower left corner.
Alternatively, if a pixel is displayed on the screen, you can use the NSReadPixel() function to get the color of the pixel in the current coordinate system.
source share