Page 1 of 1

possible bug -grayscale saving to tif IM 6.8.5.10 Q16 Mac OS

Posted: 2013-06-15T11:30:09-07:00
by fmw42
I am not sure, but this seems like a bug to me. I was expecting to get gamma=0.4545 from all the following as rec601luma is the non-linear version (as opposed to rec601luminance being the linear version).

Why do I get gamma=1 for tif and jpg and not gamma=0.4545 as per the gif and png

convert logo: -grayscale rec601luma 1tmp1.tif
Image: 1tmp1.tif
Class: DirectClass
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Alpha: False
Channels: gray
Rendering intent: Undefined
Gamma: 1


convert logo: -grayscale rec601luma 1tmp1.jpg
Image: 1tmp1.jpg
Class: PseudoClass
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Alpha: False
Channels: gray
Rendering intent: Undefined
Gamma: 1


convert logo: -grayscale rec601luma 1tmp1.png
Image: 1tmp1.png
Class: PseudoClass
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 0.45455


convert logo: -grayscale rec601luma 1tmp1.gif
Image: 1tmp1.gif
Class: PseudoClass
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 0.454545


Furthermore, I cannot seem to convert it to gamma=0.4545 for tif or jpg

convert logo: -grayscale rec601luma -colorspace sRGB 2tmp1.tif
Image: 2tmp1.tif
Class: DirectClass
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Alpha: False
Channels: gray
Rendering intent: Undefined
Gamma: 1


convert logo: -grayscale rec601luma -set colorspace sRGB 3tmp1.tif
Image: 3tmp1.tif
Class: DirectClass
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Alpha: False
Channels: gray
Rendering intent: Undefined
Gamma: 1


Is this a bug or a limitation of jpg and tif formats not keeping track of gamma? Is so why default it to 1 rather than 0.4545?



P.S. It is also a problem with -monochrome, which I would expect to have gamma=0.4545 since it only contains black and white (bilevel) which are non-linear colors.

Re: possible bug -grayscale saving to tif IM 6.8.5.10 Q16 Ma

Posted: 2013-06-15T14:13:04-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.6-0 Beta available by sometime tomorrow. However, the patch will not fix the entire problem. Some image formats do not include metadata to distinguish between luma and luminance.

Re: possible bug -grayscale saving to tif IM 6.8.5.10 Q16 Ma

Posted: 2013-06-15T14:38:20-07:00
by fmw42
magick wrote:We can reproduce the problem you posted and have a patch in ImageMagick 6.8.6-0 Beta available by sometime tomorrow. However, the patch will not fix the entire problem. Some image formats do not include metadata to distinguish between luma and luminance.
Thanks. Does the patch fix both jpg and tif? I know some other formats do not distinguish. But if jpg, png, gif and tif work that would be great.

Re: possible bug -grayscale saving to tif IM 6.8.5.10 Q16 Ma

Posted: 2013-06-16T16:49:06-07:00
by fmw42
Seems to work fine for tiff and jpg now in IM 6.8.6.0. The result is gamma=0.4545