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

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 gray(...) in txt output IM 6.8.7.1 Q16

Post 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)
snibgo
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

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
Post Reply