GIF does not always save transparency!
Posted: 2010-08-18T20:30:10-07:00
GIF read is failing in some special cases....
Download a GIF animation from IM Examples
http://www.imagemagick.org/Usage/anim_b ... s_bgnd.gif
Now I generate the "Disposal Images" of this animation.
This shows how the 'GIF background disposal' is 'clearing' the overlayed frames to transparency!
here is the animated GIF image.
As you can see the GIF animation works fine.
However anytime IM reads this image (for display, animate, or just to work on the image) the transparent parts of the image are filled to the background color and NOT to transparency!
For example read this GIF and append frames and all the transparent areas are filled in!
Or just reading and writing the GIF fills in the transparency.
The above should should have remained completely unchanged as I have not done anything but read and write it!
This ONLY happens with GIF animations,
ONLY if the first frame is fully-opaque, and later frames have transparency.
and ONLY on GIF read.
This is nothing to with applying GIF disposal methods. Just the read of the GIF and not making use of the dispose / animation aspect of the GIF image.
this bug has existed for more than a year now, though I though it was in -layers Dispose. However the above shows the bug is in GIF animation reading, as using a brwser to display the GIF animation is fine, only IM read is not correct.
Download a GIF animation from IM Examples
http://www.imagemagick.org/Usage/anim_b ... s_bgnd.gif
Now I generate the "Disposal Images" of this animation.
This shows how the 'GIF background disposal' is 'clearing' the overlayed frames to transparency!
Code: Select all
convert canvas_bgnd.gif -layers Dispose canvas_bgnd_dispose.gif
As you can see the GIF animation works fine.
However anytime IM reads this image (for display, animate, or just to work on the image) the transparent parts of the image are filled to the background color and NOT to transparency!
For example read this GIF and append frames and all the transparent areas are filled in!
Code: Select all
convert canvas_bgnd_dispose.gif +append canvas_bgnd_dispose.png
Or just reading and writing the GIF fills in the transparency.
Code: Select all
convert canvas_bgnd_dispose.gif canvas_bgnd_dispose_rw.gif
The above should should have remained completely unchanged as I have not done anything but read and write it!
This ONLY happens with GIF animations,
ONLY if the first frame is fully-opaque, and later frames have transparency.
and ONLY on GIF read.
This is nothing to with applying GIF disposal methods. Just the read of the GIF and not making use of the dispose / animation aspect of the GIF image.
this bug has existed for more than a year now, though I though it was in -layers Dispose. However the above shows the bug is in GIF animation reading, as using a brwser to display the GIF animation is fine, only IM read is not correct.