Is there a simple method for checking if an NSImage Object contains a grayscale image?
What I am trying to do is count the number of colour and black and white pages within a pdf. As far as I can tell the only real solution to this is to render the pdf pages as images and then work from there. I didn't want to have to check every pixel if possible but so far that's all I can come up with.
You can access the NSImage
's -representations
(which returns an array of NSImageRep
instances) and query the returned NSImageRep
s for these details.
Primary NSImageRep
and CGImage
details of interest include: