Post Reply 

Remove transparency in animated gif

Nov 11, 2012, 16:01
Post: #1
Remove transparency in animated gif
Hello all. I've always been fascinated by GIMP and when I learn something it's great - but I don't use it enough, so it gets really hard when I know that something can be done, but not how to do it!

I have an animated gif in which I put in a transparent background on all the frames a long time ago. But the edges of the images were all anti-aliased, so the edges look pretty bad on a much different background. Now I want to change it back to the black background on each frame, and the origial file is lost.

I went through each frame and used Select by color to select the transparency, then Edit to fill the selection with black. However, most frames have a layer boundary that is smaller than the image size because the animation does not always fill the screen. The background on each layer/frame is still transparent. When I saved that work, only the current layer boundary in each frame shows - the rest is transparent. So instead of an unchanging size image with a black background, I get a variable sized one.

So I thought I would remove the alpha channel from each frame. That looks ok while the whole image is open in GIMP, but when I go to save it, GIMP puts the alpha channels back in each frame! I don't know why it's doing that. But I did notice that when I preview the animation with the alpha channels removed, artifacts are visible when the next frame is smaller than the one before it, so I don't know that it's what I want, anyway.

Can I change the alpha channel from completely transparent to completely black? Is there another way I should try to do this? I have found a lot of tutorials online about how to make the blackgrounds transparent, but I can't find anything about undoing it.
Find all posts by this user
Quote this message in a reply
Nov 12, 2012, 13:08
Post: #2
RE: Remove transparency in animated gif
Thanks, that worked. A little tedious with 30 frames, but not bad. By merging each layer down into a black layer, the alpha channel was removed and stayed removed after I saved the file. And with each frame the full size of the image, there are no artifacts during the animation. After I merged each layer down, I lost the frame number, milllisecond delay and replace annotation in the layer name, but I just edited the new layer properties and renamed it. I'm curious as to why the alpha channel was not removed the way I was doing it before, but I fear the answer requires more level of detail than I really need.
Find all posts by this user
Quote this message in a reply
Nov 12, 2012, 16:27
Post: #3
RE: Remove transparency in animated gif
That worked too, and was much easier, so I would consider it the preferred method. I had looked for something to extend the layer boundary to the full canvas size, but I couldn't find an easy way. I don't know how I missed "Layer to Image Size". Perhaps I assumed it would scale, which I didn't want?

Interestingly again, even though I used "Remove alpha channel" on each layer, after I "saved as" with a new file name and then opened the image again, all those layers still had alpha channels, as indicated by the presence of "Remove Alpha Channel" as a menu item. It must be a function of the export during the save. Apparently I don't fully understand the alpha channel, but that's ok. There does not appear to be a difference in size of the two gif files created by the two different methods, and I have what I want.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Gif help M0orty 1 316 Mar 23, 2018 06:03
Last Post: ythgilb
  (Probably)easy transparency / background question Matthew Cole 1 325 Mar 13, 2018 18:26
Last Post: ythgilb
  compressed .gif issues Kairu 1 295 Jan 2, 2018 09:20
Last Post: paynekj
Question Saving to a gif format and choosing the color palette SpongeBob 0 343 Dec 13, 2017 19:13
Last Post: SpongeBob
  Combining gif image to static image help? littlegreendog 1 1,002 Jul 26, 2017 12:27
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS