possible bug GIF and transparency IM 6.9.0.3 Mac OSX SnowLeopard
Posted: 2015-01-04T13:36:45-07:00
I have a GIF image that has only 4 colors and one is a white background. If I add an alpha channel to it, both histogram and -unique colors show transparent black rather than transparent white. Perhaps this is just a limitation of GIF?
Input:
http://www.fmwconcepts.com/misc_tests/u ... esign4.gif
181054: ( 16, 3, 78) #10034E srgb(16,3,78)
51286: (178, 32, 24) #B22018 srgb(178,32,24)
1277: (178,211,239) #B2D3EF srgb(178,211,239)
565759: (255,255,255) #FFFFFF white
0,0: (16,3,78) #10034E srgb(16,3,78)
1,0: (178,32,24) #B22018 srgb(178,32,24)
2,0: (178,211,239) #B2D3EF srgb(178,211,239)
3,0: (255,255,255) #FFFFFF white
Now if I add a binary alpha channel so that the white background is transparent, I get:
http://www.fmwconcepts.com/misc_tests/u ... sign4a.gif
565759: ( 0, 0, 0, 0) #00000000 none
181054: ( 16, 3, 78,255) #10034E srgba(16,3,78,1)
51286: (178, 32, 24,255) #B22018 srgba(178,32,24,1)
1277: (178,211,239,255) #B2D3EF srgba(178,211,239,1)
0,0: (16,3,78,1) #10034E srgba(16,3,78,1)
1,0: (178,32,24,1) #B22018 srgba(178,32,24,1)
2,0: (178,211,239,1) #B2D3EF srgba(178,211,239,1)
3,0: (0,0,0,0) #00000000 none
Input:
http://www.fmwconcepts.com/misc_tests/u ... esign4.gif
Code: Select all
convert design4.gif -format "%c" histogram:info:
51286: (178, 32, 24) #B22018 srgb(178,32,24)
1277: (178,211,239) #B2D3EF srgb(178,211,239)
565759: (255,255,255) #FFFFFF white
Code: Select all
convert design4.gif -unique-colors txt:
1,0: (178,32,24) #B22018 srgb(178,32,24)
2,0: (178,211,239) #B2D3EF srgb(178,211,239)
3,0: (255,255,255) #FFFFFF white
Now if I add a binary alpha channel so that the white background is transparent, I get:
Code: Select all
convert design4.gif \
\( -clone 0 -fill black +opaque white -negate \) \
-alpha off -compose copy_opacity -composite \
design4a.gif
Code: Select all
convert design4a.gif -format "%c" histogram:info:
181054: ( 16, 3, 78,255) #10034E srgba(16,3,78,1)
51286: (178, 32, 24,255) #B22018 srgba(178,32,24,1)
1277: (178,211,239,255) #B2D3EF srgba(178,211,239,1)
Code: Select all
convert design4a.gif -unique-colors txt:
1,0: (178,32,24,1) #B22018 srgba(178,32,24,1)
2,0: (178,211,239,1) #B2D3EF srgba(178,211,239,1)
3,0: (0,0,0,0) #00000000 none