Possible bug with Grayscale colorspace?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
PCPete

Possible bug with Grayscale colorspace?

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possible bug with Grayscale colorspace?

Post 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.
PCPete

Re: Possible bug with Grayscale colorspace?

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possible bug with Grayscale colorspace?

Post by magick »

Yes, please. Post a URL to your image here so we can download it and inspect it.
PCPete

Re: Possible bug with Grayscale colorspace?

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Possible bug with Grayscale colorspace?

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply