possible bug in graya color specification in IM 6.4.1-7
Posted: 2008-06-13T13:03:06-07:00
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)
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)