Page 1 of 1

possible bug gray(...) in txt output IM 6.8.7.1 Q16

Posted: 2013-10-22T17:50:56-07:00
by fmw42
gray(...) is not producing the correct results for txt output whether raw values or %

The following should produce values of 50/255=19.6% and not 48%

convert -size 1x1 xc:"gray(50)" -colorspace sRGB txt:
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (48.009460593575951748%,48.009460593575951748%,48.009460593575951748%) #7AE77AE77AE7 srgb(48.009460593575951748%,48.009460593575951748%,48.009460593575951748%)


The following should produce values of 50% and not 73%

convert -size 1x1 xc:"gray(50%)" -colorspace sRGB txt:
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (73.534752422369720648%,73.534752422369720648%,73.534752422369720648%) #BC3FBC3FBC3F srgb(73.534752422369720648%,73.534752422369720648%,73.534752422369720648%)

P.S.

This seems to be associated with the addition of -colorspace sRGB and the fact that gray(...) is linear, so there is a conversion from linear to non-linear. Is this a correct behavior? Perhaps I am mistaken about this being a bug. If I leave off the -colorspace sRGB, then I get the expected results.



convert -size 1x1 xc:"gray(50)" txt:
# ImageMagick pixel enumeration: 1,1,65535,gray
0,0: (19.607843137254903354%,19.607843137254903354%,19.607843137254903354%) #323232323232 gray(50)

Re: possible bug gray(...) in txt output IM 6.8.7.1 Q16

Posted: 2013-10-22T19:36:52-07:00
by snibgo
Bug confirmed in 6.8.7-1 under Windows 7. The bug wasn't present in 6.8.7-0 nor a recent 6.8.7-1beta.

Re: possible bug gray(...) in txt output IM 6.8.7.1 Q16

Posted: 2013-10-23T03:19:56-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.7-2 Beta available by sometime tomorrow. Thanks.