animated gif from imagemagick

put the list of files into a file

ls -1 foo*.jpg > /var/tmp/jpglist

rename randomly named files in numerical order

cat /var/tmp/jpglist|perl -e'$i=1;while ($name=) { chomp $name;$new="week" . $i . ".jpg";system ("cp $name $new");;$i++};'

resize all 13 files named week[number].jpg, add the Week[number].jpg to the lower right hand corner of the file

for file in {1..13} ;do convert -adaptive-resize 256x -gravity SouthEast  -pointsize 30 -annotate 0 "Week $file" week$file.jpg week${file}_sm.jpg; done

stack the jpgs into a animated gif, center the extra vertical space (not all the images are the same height, the tallest image is about 350 pixels).

convert -delay 200 -loop 0 -gravity center -extent 256x350 -coalesce -trim -layers TrimBounds -dispose 2 week[1-9]_sm.jpg week1[0-9]_sm.jpg animated.gif

Leave a Reply

Your email address will not be published. Required fields are marked *