I have two GIFs of different sizes. I want to be able to place a GIF2 to a background GIF1 at a specific location and at the same time add text to the result. I am new to ImageMagick world, please help.
I am trying to achieve the following result where dog sticker is in a separate GIF.
How to place a GIF on another GIF, where both GIFs are of different sizes.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to place a GIF on another GIF, where both GIFs are of different sizes.
Do the two animations have the same delays and number of frames? If not, see https://www.imagemagick.org/Usage/anim_mods/#merging.
It would help if you post your two animations and background image as well as tell us your IM version and platform.
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
It would help if you post your two animations and background image as well as tell us your IM version and platform.
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to place a GIF on another GIF, where both GIFs are of different sizes.
If your animations have the same delay and number of frames, you can do:
Background:
Animation1:
Animation:2
Background:
Animation1:
Animation:2
Code: Select all
convert skyblue.gif \
null: \
\( morph_anim_1pt.gif -coalesce \) \
-gravity northwest -geometry +20+20 -compose over -layers composite \
null: \
morph_anim_5pts.gif \
-gravity southeast -geometry +20+20 -compose over -layers composite \
-layers optimize \
result.gif
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to place a GIF on another GIF, where both GIFs are of different sizes.
Perhaps this is more what you want. Imagemagick command line code in unix syntax:
The background animation has 3 frames and foreground one has 11 frames. So I repeat the background 4 times and remove the last frame so there is a total of 11 frames for the background. I coalesce the animation and add text to each frame using -annotate. Then I use -layers composite to overlay the foreground animation onto the background.
Background:
Foreground:
The background animation has 3 frames and foreground one has 11 frames. So I repeat the background 4 times and remove the last frame so there is a total of 11 frames for the background. I coalesce the animation and add text to each frame using -annotate. Then I use -layers composite to overlay the foreground animation onto the background.
Background:
Foreground:
Code: Select all
convert -delay 20 \
\( glitter_blue_tiled.gif glitter_blue_tiled.gif \
glitter_blue_tiled.gif glitter_blue_tiled.gif \
-coalesce \
+delete -font arial -pointsize 28 -gravity north \
-annotate +0+20 "TESTING" \) \
null: \
\( coalesced_k.gif -coalesce \) \
-gravity south -geometry +0+20 \
-compose over \
-layers composite \
-layers optimize \
-loop 0 \
result2.gif