Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

This script does the job :

# $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/*
  filename=`basename $filename`
  montage -tile 2x1 -geometry 512x512 first/$filename second/$filename concat$filename
convert concat* output.gif

rm -rf first
rm -rf second
rm concat*
share|improve this answer
the montage command is what did it eventually, but I resolved this on my own months ago... – JeremyKun Nov 1 '12 at 2:35

convert if provided with more than 1 input image and provided with the -delay option will output animated gif's if the output format is gif.

I used to use this link as my reference guide back in the day: http://www.imagemagick.org/Usage/anim_basics/

share|improve this answer
This does not do what I want. Instead, it concatenates the animations. I want it to run the two simultaneously side by side. – JeremyKun Jun 6 '12 at 18:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.