0

So I took a gif, and edited out the background for each frame.

When I go to filters -> animation -> playback it plays the gif perfectly fine with a transparent background.

http://imgur.com/a/AEt5Q

After exporting the gif and opening it up on an image viewer, the background is gone, but instead of it being transparent, it's turned into a white background.

http://imgur.com/a/G5DJI

I've tried using optimize for gif, but it doesn't change anything. I also have tried exporting the gif as both png and gif format.

  • 1
    Are you sure the background is white? Maybe the image viewer just displays the transparent part in a white color. Try to open the gif in Gimp again. Also please embed the original images, and not just (overly large) screenshots. – Socowi Feb 9 '17 at 20:57
  • You say "opening it up on an image viewer" - but you don't say which one. Not all image viewers support transparency. Have you tried viewing the GIF in a browser, where GIFs are meant to be viewed? – Billy Kerr Jun 10 '17 at 9:20
1

Works for me, different viewers (Firefox, Gwenview), different backgrounds, so Gimp encodes transparent pixels:

Exemple image

However, remember that in a GIF, there is no partial transparency, so you won't get smooth edges (the circles are smooth in the original image, but jagged in the GIF). To get smooth edges, you have to use Filters>Web/Semi-flatten, but this works only for a specific background color.

Edit: You can insert your image into some html that sets a specific background and look at the result by loading the resulting file in your navigator:

<html>
<body>
<!--<div style="background-color: #00ff00"> -->
<div style="background-image: url(pattern.png)">
<img src=TransparentAnim.gif />
</div>
</body>
</html>

If you see the background behind your image, then you image is good and whatever unexpected background you get is from the image viewer or the web site and not from your image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.