Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick and transparent background for animated gif

Tags:

imagemagick

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?

like image 215
noober Avatar asked Feb 03 '13 19:02

noober


1 Answers

I've found -dispose previous.

UPDATE

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

like image 104
noober Avatar answered Oct 06 '22 19:10

noober