Page 1 of 1

Possible bug with Grayscale colorspace?

Posted: 2008-01-18T10:41:26-07:00
by PCPete
I have an image that is RGB according to photoshop, although it looks black and white, gray scale. However, upon capturing the color space from IM, it believes it is a GRAY colorspace. I know it is not because of the channels. How does IM determine a Grayscale colorspace?

I have to convert the image to a particular color space based on what it comes in as, if I can not put confidence in correctly identifying that, then this is not good.

Re: Possible bug with Grayscale colorspace?

Posted: 2008-01-18T11:57:28-07:00
by magick
ImageMagick declares a grayscale colorspace if, for each pixel, red = green and green = blue. If you can identify a pixel where this condition is not true, but ImageMagick still claims its grayscale, that would be a bug in ImageMagick.

Re: Possible bug with Grayscale colorspace?

Posted: 2008-01-18T13:15:16-07:00
by PCPete
I have found many pixels in my image that has a colorspace of "DirectClassGray" that your scenario does not fit. It is very close but not true such that R=37,G=38,B=37 and so on. I have no encountered a deviance of more than 1 so far, and this is using the color dropper in Adobe PS CS3. I could share with you my image (it was a random google image) that photoshop cs3 declares as RGB but imageMagic declares as greyscale.

-Pete

Re: Possible bug with Grayscale colorspace?

Posted: 2008-01-18T13:26:51-07:00
by magick
Yes, please. Post a URL to your image here so we can download it and inspect it.

Re: Possible bug with Grayscale colorspace?

Posted: 2008-01-18T14:47:08-07:00
by PCPete
It was taken from a google image search just on a whim. You may notice most of the pixels are exactly equal, but I did find a many there were not, but close, as mentioned.

EDIT - (I will have to upload the image to my personal server which I can't access from here, I incorrectly linked the wrong image a moment ago. I will do so asap but likely not before saturday.)

thank you,

-Pete

Re: Possible bug with Grayscale colorspace?

Posted: 2008-01-30T18:07:37-07:00
by anthony
More than likely that image was JPEG (or TIFF with JPEG compression). Which due to its 'lossy' compression method can result in in-exact colors, especialling in the Blue channel...

See IM Examples, JPEG Compression
http://imagemagick.org/Usage/formats/#jpg