#!/bin/bash # number to start with to call the original files (usually not changed) COUNT=1 # number to start with to name the new files (usually not changed) COUNT2=1 # total number of original files OTOTAL=250 # total number of end files ETOTAL=250 # angle of the pictures in the first file ANGLE=0 while [ $COUNT -le $OTOTAL ]; do if [ $COUNT -lt $OTOTAL ]; then VAR=`printf "%03d" $COUNT` elif [ $COUNT -eq $OTOTAL ]; then COUNT=0 VAR=$OTOTAL fi # An image sequence is cut into a 4x4 array and pasted over the same sequence. The 4x4 array is comprised of # circular transparent masks which rotate 360 degrees. convert $VAR.png \( \( \( \( transparentwhite.png \( $VAR.png -crop 180x144+0+0 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+180+0 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+360+0 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+540+0 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \) +append \) \( \( \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+0+144 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+180+144 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+360+144 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+540+144 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \) +append \) \( \( \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+0+288 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+180+288 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+360+288 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+540+288 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \) +append \) \( \( \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+0+432 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+180+432 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+360+432 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \( transparentwhite.png \( $VAR.png +gravity -crop 180x144+540+432 -rotate $ANGLE \) -gravity center -compose src-in -composite \) -matte -background none \) +append \) -append \) -compose src-over -composite movie/$VAR2.png echo $VAR2 let COUNT=COUNT+1 #add to angle so that picture rotates 360 degrees during animation ANGLE=$(echo "scale=2; $ANGLE + 360 / $ETOTAL" | bc) if [ $COUNT2 -le $ETOTAL ]; then VAR2=`printf "%04d" $COUNT2` elif [ $COUNT2 -gt $ETOTAL ]; then break fi let COUNT2=COUNT2+1 done