Read the links I provided above for examples.
In unix, it can be done as follows using subshell processing. The direction is controlled by the incx and incy arguments. Though you can give a direction and increment and convert that to its x and y increments.
Code: Select all
incx=5
incy=5
wd=250
ht=250
numx=`convert xc: -format "%[fx:$wd/$incx]" info:`
numy=`convert xc: -format "%[fx:$wd/$incx]" info:`
num=`convert xc: -format "%[fx:max($numx,$numy)]" info:`
echo "num=$num;"
offx=0
offy=0
(
for ((i=0; i<num; i++)); do
convert still.gif -roll +${offx}+${offy} -gravity center -crop ${wd}x${ht}+0+0 +repage miff:-
offx=$((offx+incx))
offy=$((offy+incy))
done
) | convert -dispose previous -delay 20 - -loop 0 -layers optimize animation.gif
Sorry I do not know how to do this in Windows scripting.
It can also be done by using -distort SRT and just use the oldx,oldy and newx,newy to control the direction. You would also have to provide a viewport crop. See
http://www.imagemagick.org/Usage/distorts/#srt
http://www.imagemagick.org/Usage/distor ... t_viewport
The roll is easier, but only works in full pixel increments. SRT can do fractional pixel shifts.