Search code examples
imagemagickimagemagick-convert

Add mutliple gifs to one background


I'm attempting to "play" the same gif, all at once, in multiple areas of a same, single, image. Reading thru the documentation for IM v6, there are no examples of this. I have also attempted chaining separate 'convert' composite commands without any luck.

Is it possible to do this in one command or multiple?


Solution

  • In ImageMagick, you can use null: and -layers composite to combine multiple animations onto one background image. But each animation must have the same number of frames and delays. For example in unix syntax with new line character \ (replace with ^ for Windows):

    enter image description here

    convert -size 512x512 xc:black \
    null: morph_anim_1pt.gif -gravity northwest -geometry +50+50 -layers composite \
    null: morph_anim_1pt.gif -gravity southwest -geometry +50+50 -layers composite \
    null: morph_anim_1pt.gif -gravity southeast -geometry +50+50 -layers composite \
    null: morph_anim_1pt.gif -gravity northeast -geometry +50+50 -layers composite \
    morph_anim_1pt_animation.gif
    

    enter image description here

    See http://www.imagemagick.org/Usage/anim_mods/#composite