One more: sRGB grayscale PNGs getting too dark
Posted: 2013-05-17T12:08:39-07:00
Hi everyone,
perhaps my problem will eventually dissolve into thin air once a more recent version of IM gets available through the Debian repositories (I'm on 6.7.7-10 2012-11-06 for Sid), but I keep wondering about a certain aspect of colorspace handling.
Apparently, many of you already have encountered the problem that grayscale images, which are -- according to identify output -- in sRGB, turn out too dark when converting them and saving them as png. The commonly found explanation is that IM is so smart that it assumes grayscale images to be intended to be linear, even though they were initially non-linearly encoded. Depending on the IM version in question, various combinations of colorspace settings or operations have been proposed to circumvent this problem, and with the IM version I'm stuck with setting the "working colorspace" to RGB seems to do the trick.
Alas, when doing something like "convert -set colorspace RGB in.png out.png" on a non-grayscale sRGB image, out.png turns out too light!
Of course, it would be possible to force a linear RGB working colorspace only for grayscale input images, but that would require determining whether in.png is grayscale or not before applying the actual conversion -- something I find kinda clumsy and which I'd seriously like to avoid.
So the question is: Is there (or will there be) a way to treat sRGB input png images so that their conversion results will *never* be too dark or too light and *always* be sRGB, no matter if the input is grayscale or not?
Curious about your opinions --
tcrass
perhaps my problem will eventually dissolve into thin air once a more recent version of IM gets available through the Debian repositories (I'm on 6.7.7-10 2012-11-06 for Sid), but I keep wondering about a certain aspect of colorspace handling.
Apparently, many of you already have encountered the problem that grayscale images, which are -- according to identify output -- in sRGB, turn out too dark when converting them and saving them as png. The commonly found explanation is that IM is so smart that it assumes grayscale images to be intended to be linear, even though they were initially non-linearly encoded. Depending on the IM version in question, various combinations of colorspace settings or operations have been proposed to circumvent this problem, and with the IM version I'm stuck with setting the "working colorspace" to RGB seems to do the trick.
Alas, when doing something like "convert -set colorspace RGB in.png out.png" on a non-grayscale sRGB image, out.png turns out too light!
Of course, it would be possible to force a linear RGB working colorspace only for grayscale input images, but that would require determining whether in.png is grayscale or not before applying the actual conversion -- something I find kinda clumsy and which I'd seriously like to avoid.
So the question is: Is there (or will there be) a way to treat sRGB input png images so that their conversion results will *never* be too dark or too light and *always* be sRGB, no matter if the input is grayscale or not?
Curious about your opinions --
tcrass