Page 1 of 1

[SOLVED] White pixels on first frame of gif animation

Posted: 2013-03-13T07:49:32-07:00
by halpme
I'm making an animated gif from a couple of PNG images.

The problem I'm having is that when the animation repeats the first frame has a couple of transparent pixels, which lets the web page background color (white) shine through.

This makes the gif very ugly because the animation looks fine except for that one frame that has a bunch of white pixels in random places "blinking" briefly. These white pixels are in otherwise dark colors of the image, making me think ImageMagick assumes that the transparent color is black...?

If I skip "-layers Optimize" the problem goes away but the gif file turns out twice as large as otherwise so that's not really an option.

How do I disable transparent pixels for the first frame in my gif animation? Or change them to solid non-transparent black?

Help me anthony, you're my only hope!

Re: White pixels on first frame of gif animation

Posted: 2013-03-13T10:27:52-07:00
by fmw42
I do not do animations much, but you could simply process the first image separately with -alpha off and then list all the rest of the images.

Re: White pixels on first frame of gif animation

Posted: 2013-03-13T11:41:34-07:00
by halpme
Do you have a code example, please?

If possible I'd like to do it with the *.png input I have right now but I'm flexible to change it if needed.

Re: White pixels on first frame of gif animation

Posted: 2013-03-13T12:00:51-07:00
by fmw42
I could create something for unix syntax, but it would have to wait until tomorrow as I will be out the rest of the day. But perhaps one of the Windows users can show you what to do.

Re: White pixels on first frame of gif animation

Posted: 2013-03-13T17:09:16-07:00
by fmw42
How many images do you have for input? Perhaps you can post a few of them including the first one. Then we will have something to work with that shows your problem.

Re: White pixels on first frame of gif animation

Posted: 2013-03-14T03:06:57-07:00
by halpme
Very sorry but I can't post these images for the public. As for the number of images, there are 14 of them.

Still hoping for a solution. Perhaps something with parentheses? Like maybe that I can put the first image into the gif and not to any optimization on it and then append the rest of the images with the "-layers Optimize" flag?

Edit: Solved it myself by building my optimized loop inside parentheses (used -respect-parenthesis), then deleting the first frame and adding a new first frame to the list of images outside the parentheses. No white pixels and the gif is optimized!