#!/bin/bash
FRAMES=10
#create basic frame
convert -size 100x100 plasma:fractal base.png
#create individual frames which are rotated copies of basic frame
for i in `seq ${FRAMES}`
do
convert -swirl $(((360*${i})/${FRAMES})) base.png anim${i}.png
echo "frame ${i}/${FRAMES}"
done
#convert individual frames to animated gif
echo "please wait while converting to gif"
echo "this could take a while depending on complexity"
convert -loop 0 -delay 10 anim*.png anim.gif
#clean up unneeded files
rm -f anim*.png base.png
#show image in browser
URL="`pwd`/anim.gif"
firefox -remote "ping()" &>/dev/null
if [[ $? == "0" ]]
then
firefox -remote "openFile(${URL})"
else
firefox "${URL}" &
fi