Problem with gif with transparent background

Your gif is disposal = 3 that means it needs previous image as it renders incrementally. The problem is the image is with black background and not white …

Here are the disposals possible:

     if (disposal==0) s="no animation";
else if (disposal==1) s="leave image as is";
else if (disposal==2) s="clear with background";
else if (disposal==3) s="restore previous image";
else                  s="reserved";

When I render it with my decoder it looks like this:

[![capture][1]][1]

So there are 2 possible things at play here:

  1. transparency

maybe this should be handled as transparent image with background but even decent image viewer (like FastStone Image Viewer) shows the same thing so I doubt this is the case…

  1. extentions

This is the most likely cause. Nowadays WEB browsers (for few years now) depend on undocumented custom made extentions added to GIFs extention packets (and not part of any GIF specs) and ignores the GIF file format completely for some aspects of rendering (like looping). Simply because all of them use the same image lib for decoding GIFs which is simply coded badly (or by design)…

for more info see:

So my guess is the GIF of yours have some extention packet telling brownser to use different disposal method then the one stored in GIF header. So simply your GIF is buggy and only buggy GIF decoder can render it properly …

So your decoder ignores the background color of GIF hence rendering incorrectly as the incremental render does not work with non black color background …

Leave a Comment