ImageMagick and transparent background for animated gif

noober picture noober · Feb 3, 2013 · Viewed 11.9k times · Source

I have an animation as a batch of .png files (100 files). The background is transparent in the source .png files. I want to convert them into a single animated gif. I have tried this command:

convert -delay 0 -loop 0 -alpha set *.png ani.gif

But the result is the following (green is the HTML page background):

enter image description here

How should I remove the previous frames from an every following one?

Answer

noober picture noober · Feb 3, 2013

I've found -dispose previous.

UPDATE

OK, convert -delay 0 -loop 0 -alpha set -dispose previous *.png ani.gif