Page 1 of 1

Overlaying animated gif on jpeg

Posted: 2007-03-04T09:46:44-07:00
by defied
Hello,

I'm having a problem when overlaying an animated gif over a jpeg file.
Here is what I use:

Code: Select all

 convert source.jpg \
            \( -clone 0 bigheart-0.gif -composite -geometry +30+30 \) \
            \( -clone 0 bigheart-1.gif -composite -geometry +30+30  \) \
            \( -clone 0 bigheart-2.gif -composite -geometry +30+30 \) \
            -delete 0 -set delay 25  output.gif
the image generated is the source image with the animated gif ontop, but I can't seem to position the animated overlay.
How do I position the animated layer to a certain position?
Also, is there an easier way than the method I use? I need to +adjoin an animated gif, only then I can use the animated gif to put over the source jpeg.

Thank you,
Joe

Re: Overlaying animated gif on jpeg

Posted: 2007-03-04T12:45:13-07:00
by defied
I think I found a solution

Code: Select all

convert source.jpg \
            \( -clone 0 bigheart-0.gif -geometry +30+10 -composite \) \
            \( -clone 0 bigheart-1.gif -geometry +30+10 -composite \) \
            \( -clone 0 bigheart-2.gif -geometry +30+10 -composite \) \
            -delete 0 -loop 0 output.gif

Re: Overlaying animated gif on jpeg

Posted: 2007-03-04T19:07:32-07:00
by anthony
You may also like to look at IM Examples, Remove transparency
http://www.imagemagick.org/Usage/animat ... pose_under

Basically you can use -draw to underlay an image under each frame of an animation of unknown length and size.

Code: Select all

convert bigheart_animation.gif  -coalease \
            -draw 'image DstOver 0,0 0,0 "source.jpg"' \
            -layers optimize     bigheart_background.gif
the final size of the animation is as per the origianl animation.

I had planed to create a 'underlay a background' section, but it basically would repeat that simple example.