#!/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=500 # angle of the pictures in the first file ANGLE=0 # start X position of picture (half of original image width + 20) XVALUE=200 # saves original xvalue for use in x position calculation GVALUE=$XVALUE while [ $COUNT -le $OTOTAL ]; do if [ $COUNT -lt $OTOTAL ]; then VAR=`printf "%03d" $COUNT` elif [ $COUNT -eq $OTOTAL ]; then COUNT=0 VAR=$OTOTAL fi # repage to put the center of the rotation in the middle of the original picture. use $angle to calculate affine rotation. # crop creates pal background $xvalue determines current x position of the rotating picture. convert $VAR.jpg -repage -180-144 -affine `affine_rotate $ANGLE` -transform -compose copy +compose -crop 720x576$XVALUE2-288\! -background lightblue -flatten movie/long_moving_affine_$VAR2.jpg 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) #add to x position so that the picture moves across the background during animation #Distance to travel is total width of background plus foreground image (so it can't be seen at start and finish) XVALUE=$(echo "scale=2; $XVALUE - (2 * $GVALUE + 720) / $ETOTAL" | bc) XVALUE2=`printf "%+f" $XVALUE` if [ $COUNT2 -le $ETOTAL ]; then VAR2=`printf "%04d" $COUNT2` elif [ $COUNT2 -gt $ETOTAL ]; then break fi let COUNT2=COUNT2+1 done