ImageMagick 6.8.4 darkening grayscale images on convert

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.
henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by henrywho » 2013-04-02T20:16:51-07:00

"Gray problems" seem to pop up a while after the other. I try to avoid them by adding "-set colorspace srgb" immediately after the input image. So far it works.

Edit: oops... not for 6.8.4-5

User avatar
fmw42
Posts: 25577
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by fmw42 » 2013-04-02T20:52:57-07:00

henrywho wrote:"Gray problems" seem to pop up a while after the other. I try to avoid them by adding "-set colorspace srgb" immediately after the input image. So far it works.

Edit: oops... not for 6.8.4-5

I am not sure that process you mention will not work with grayscale images. It fails for me when the input gray images is already non-linear sRGB gray (as per the images for the above post). It is probably fine for color images, since mostly they are already sRGB. So it really does not matter if you add that.

6.8.4.5 had particular issues that I also found. Hopefully, I think 6.8.4.7 (beta) is more solid, since all of the problems I have found were worked out in 6.8.4.6 and the .7 beta.
Last edited by fmw42 on 2013-04-02T20:55:11-07:00, edited 1 time in total.

snibgo
Posts: 12163
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by snibgo » 2013-04-02T20:54:38-07:00

jhuckaby wrote:Try to view output.jpg. It will be much darker than the original.
snibgo wrote:But other programs don't follow this convention, and think g2.jpg is in sRGB colorspace, and display it accordingly.
I should perhaps say that IMdisplay, the viewer included in ImageMagick, displays both images the same (for v6.8.4-6). It recognises that one image is sRGB and the other is RGB. Gimp and Microsoft tools don't, so they display the output too dark.

One day, we will proudly say that IM led the vanguard for standardising Gray=RGB. Maybe.
snibgo's IM pages: im.snibgo.com

henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by henrywho » 2013-04-03T01:22:28-07:00

fmw42 wrote:I am not sure that process you mention will not work with grayscale images. It fails for me when the input gray images is already non-linear sRGB gray (as per the images for the above post).
It worked a year ago when Imagemagick treated gray images (no matter grayscale or "color" images with gray shades only) as linear scale.

User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by glennrp » 2013-04-03T08:46:48-07:00

IM-6.8.4-6 is writing a gamma chunk in PNG output even when the iCCP chunk is also being written with a different effective gamma. I've checked in a change to IM-6.8.4-7 that will omit writing the gAMA and cHRM chunks when either the sRGB or iCCP chunk is being written. This may change the appearance (brightness/darkness) of some PNG ouput files when they are read by other applications that don't use the iCCP chunk.

User avatar
fmw42
Posts: 25577
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by fmw42 » 2013-04-03T10:49:02-07:00

henrywho wrote:
fmw42 wrote:I am not sure that process you mention will not work with grayscale images. It fails for me when the input gray images is already non-linear sRGB gray (as per the images for the above post).
It worked a year ago when Imagemagick treated gray images (no matter grayscale or "color" images with gray shades only) as linear scale.
That is reasonable, since RGB and sRGB were reversed then. So using -set colorspace sRGB in the older versions is like using -set colorspace RGB in the newer versions.

henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by henrywho » 2013-04-03T17:15:35-07:00

fmw42 wrote:That is reasonable, since RGB and sRGB were reversed then. So using -set colorspace sRGB in the older versions is like using -set colorspace RGB in the newer versions.
That's after the reversion of "-colorspace RGB" and "-colorspace sRGB"

User avatar
fmw42
Posts: 25577
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick 6.8.4 darkening grayscale images on convert

Post by fmw42 » 2013-04-03T17:34:29-07:00

That's after the reversion of "-colorspace RGB" and "-colorspace sRGB"

My apologies.

From your earlier post
ImageMagick 6.8.4-5 Q8 - Bug is reproducible
ImageMagick 6.8.3-10 Q8 - NOT REPRODUCIBLE
6.8.3.10 was after the swap in colorspace (which was from about 6.7.6.7 to about 6.7.7.7), though there was a change that occurred at about that time 6.8.3.9, 6.8.3.10 and 6.8.4.0. 6.8.3.10 was rather odd from my tests. However, I do not know if this relates to your issue.

Post Reply