#! /bin/sh
#
# immagic.sh
#
# turn a series of rgb images into
# an animated gif
#
# by glenn lawyer
############################


# Make sure you are in the directory where you saved the output of
# the snapshots.tcl script.

for im in $(ls *.rgb | sort -n); do
    trg=$(basename $im .rgb)
    convert $im -resize 60% ${trg}.gif     # turn the rgbs into gifs
    #rm -f $im                             # clean up
done;

# combine the gifs into the animation
convert -dispose background -delay 5 $(ls *.gif | sort -n) animation.gif





