Search code examples
imagemagick

ImageMagick and transparent background for animated gif


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?


Solution

  • I've found -dispose previous.

    UPDATE

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