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

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

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

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Seems to work fine for tiff and jpg now in IM 6.8.6.0. The result is gamma=0.4545
Post Reply