possible bug in graya color specification in IM 6.4.1-7

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 in graya color specification in IM 6.4.1-7

Post by fmw42 »

First: according to http://imagemagick.org/script/color.php

graya(100%,0.5) should be white with 50% transparency

but no matter what value specified for the transparency in the above, it always turns out to be fully opaque (i.e. equivalent to 0)

convert -size 100x100 xc:"graya(100%,0.5)" white_a0p5.png

This is fully opaque white.

convert white_a0p5.png -verbose info:
Colorspace: Gray
Depth: 16/1-bit
Channel depth:
gray: 1-bit
alpha: 1-bit
Channel statistics:
gray:
min: 1 (1)
max: 1 (1)
mean: 1 (1)
standard deviation: -0 (-0)
alpha:
min: 0 (0)
max: 0 (0)
mean: 0 (0)

standard deviation: -0 (-0)



Second, I am also puzzled by change in the alpha in the rgba color specification with what is shown in the verbose info. It appears to be changed to 1-a in the verbose info. Is this intended? Seems confusing even though the correct result is generated.

convert -size 100x100 xc:"rgba(100%,100%,100%,0)" white_rgba0.png

convert white_rgba0.png -verbose info:
Colorspace: Gray
Depth: 16/1-bit
Channel depth:
gray: 1-bit
alpha: 1-bit
Channel statistics:
gray:
min: 1 (1)
max: 1 (1)
mean: 1 (1)
standard deviation: -0 (-0)
alpha:
min: 1 (1)
max: 1 (1)
mean: 1 (1)

standard deviation: -0 (-0)
Alpha: rgba(255,255,255,1) #FFFFFFFFFFFF0000

This last line above for Alpha is just opposite of what it should be reported as an rgba opaque color. It implies a fully transparent color according to the link at the top.

Note: similar alpha inversion (1-a) is also being reported when using txt:-

convert -size 1x1 xc:"rgba(100%,100%,100%,0)" txt:-
# ImageMagick pixel enumeration: 1,1,65535,rgba
0,0: (65535,65535,65535,65535) #FFFFFFFFFFFF0000 rgba(255,255,255,1)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug in graya color specification in IM 6.4.1-7

Post by magick »

We can reproduce the problem you posted and have a fix. Look for ImageMagick 6.4.1-8 Beta sometime tomorrow.
Post Reply