possible bug -threshold 0 on alpha channel
Posted: 2018-02-20T23:13:06-07:00
IM 6.9.9.35 Q16 Mac OSX Sierra
# ImageMagick pixel enumeration: 4,1,65535,srgba
0,0: (54227,45746,40606,0) #D3B29E00 srgba(211,178,158,0)
1,0: (54227,45746,40606,62708) #D3B29EF4 srgba(211,178,158,0.956863)
2,0: (54227,45489,40606,47288) #D3B19EB8 srgba(211,177,158,0.721569)
3,0: (54227,45746,40606,65535) #D3B29EFF srgba(211,178,158,1)
The above image has 1 fully transparent alpha value, 1 fully opaque alpha value and two partially transparent alpha values.
I want to threshold the alpha channel at 0. So all values but the alpha=0 should go to 1. But the opposite is happening. All values but alpha=1 go to 0.
# ImageMagick pixel enumeration: 4,1,65535,srgba
0,0: (54227,45746,40606,0) #D3B29E00 srgba(211,178,158,0)
1,0: (54227,45746,40606,0) #D3B29E00 srgba(211,178,158,0)
2,0: (54227,45489,40606,0) #D3B19E00 srgba(211,177,158,0)
3,0: (54227,45746,40606,65535) #D3B29EFF srgba(211,178,158,1)
Should not the two alpha values in red actually be 1?
P.S. This goes back at least as far as 6.9.8.3. I have not tested earlier versions
Code: Select all
convert xc:"#D3B29E00" xc:"#D3B29EF4" xc:"#D3B19EB8" xc:"#D3B29EFF" +append tmp1.png
Code: Select all
convert tmp1.png txt:
0,0: (54227,45746,40606,0) #D3B29E00 srgba(211,178,158,0)
1,0: (54227,45746,40606,62708) #D3B29EF4 srgba(211,178,158,0.956863)
2,0: (54227,45489,40606,47288) #D3B19EB8 srgba(211,177,158,0.721569)
3,0: (54227,45746,40606,65535) #D3B29EFF srgba(211,178,158,1)
The above image has 1 fully transparent alpha value, 1 fully opaque alpha value and two partially transparent alpha values.
I want to threshold the alpha channel at 0. So all values but the alpha=0 should go to 1. But the opposite is happening. All values but alpha=1 go to 0.
Code: Select all
convert tmp1.png -channel a -threshold 0 +channel tmp2.png
Code: Select all
convert tmp2.png txt:
0,0: (54227,45746,40606,0) #D3B29E00 srgba(211,178,158,0)
1,0: (54227,45746,40606,0) #D3B29E00 srgba(211,178,158,0)
2,0: (54227,45489,40606,0) #D3B19E00 srgba(211,177,158,0)
3,0: (54227,45746,40606,65535) #D3B29EFF srgba(211,178,158,1)
Should not the two alpha values in red actually be 1?
P.S. This goes back at least as far as 6.9.8.3. I have not tested earlier versions