I am making tools that do conversions and make decisions based on if an image fits these categories:
1 bit black and white
8 bit greyscale
8 bit RGB indexed palette
24 bit RGB
everything else above that is considered 24 bit RGB to me, since we just handle that as a "full color" image, as that fills my needs for high quality color images.
It seems I can figure out what category an image is in, using idetify and:
If colorspace is gray, check the bit depth (%z) for 1 or 8 to see if BW or grayscale.
If colorspace is RGB, check unique colors (%k) to see if its below 256, that would be the indexed color image.
Problem is the %k (unique colors) is slow as IM has to look through the whole image. -ping does not help, and I am dealing with images 10k x 10k pixels.
It just seems like the wrong way to do things too - checking the unique colors - not bulletproof by any means.
Also, I am testing IM through a DOS prompt in windows 7 64 bit. Would running it through the com wrapper be faster?
My final tools are done in C#, so I could use the com or .net wrappers.
Civil Engineer / Programmer