Running two animations side-by-side using ImageMagick

command lineimagemagick

I have two animations (.gif files) I want to run side-by-side. Can this be done with ImageMagick?

Moreover, I want to start one of the gifs after thirty frames of the other have passed. Can this be done as well? Otherwise, I can manually insert thirty frames of blackness into one image, but it would be easier to automate this step with ImageMagick, because I will potentially be doing this many times.

Best Answer

This script does the job :

#!/bin/bash
# $1 : first gif
# $2 : second gif

mkdir first
cd first
convert $1 x%04d.gif
cd ..
mkdir second
cd second
convert $2 x%04d.gif
cd ..

for filename in first/*
do
  filename=`basename $filename`
  montage -tile 2x1 -geometry 512x512 first/$filename second/$filename concat$filename
done
convert concat* output.gif

rm -rf first
rm -rf second
rm concat*
Related Question