Monday, February 8, 2010

How to make an animated gif with small file-size

I wanted to make an animation showing the evolution of global temperature and the number of sunspots over the last 129 years. I used gnuplot to spit out 129 png files (each of size 2k to 14k), then the question was how to make the animation.
Initially I tried:
convert -delay 10 -loop 0 *.png -delay 1000 2009.png Anim.gif
which made a grand-looking animated gif, but its size was enormous - over 1 megabyte! Many thanks to Patrick Welche for telling me to try the deconstruct flag:
convert -delay 10 *.png -deconstruct Anim.gif
which makes a 161k animation.
Here is a link to the resulting animated gif (161k)