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)
possible bug gray(...) in txt output IM 6.8.7.1 Q16
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: possible bug gray(...) in txt output IM 6.8.7.1 Q16
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.
snibgo's IM pages: im.snibgo.com
Re: possible bug gray(...) in txt output IM 6.8.7.1 Q16
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.7-2 Beta available by sometime tomorrow. Thanks.