bertez wrote: ↑2018-04-05T06:26:04-07:00Hi, I have an static jpg image and I want to append an animated gif below the jpg to generate a
animated image combining both,...
Here's a command that should give you nearly the result you've described...
Code: Select all
convert background.jpg -alpha set -background none \( animated.gif -coalesce \) \
-set page "%[fx:u.w]x%[fx:u.h+v.h]+%[fx:t?(u.w-v.w)/2:0]+%[fx:t?u.h:0]" -coalesce \
null: -insert 1 -layers composite -loop 0 result.gif
First it reads in your background JPG, then reads in your animated GIF and turn it into full frames.
Then it builds a canvas around each image the width of the background image, and the total height of the background plus a GIF frame. It also sets the geometry to locate the animated frames centered at the bottom of the background image.
Next it uses a "null:" separator and "-layers composite" to essentially append each animated frame to the bottom of a copy of the background image.
Then add your "-loop 0", delays, optimizing, etc., and output the finished GIF.
This is in *nix syntax. To use a command like this in Windows, change all the continued-line backslashes "\" into carets "^", and remove the backslash escapes "\( \)" from the parentheses "( )". In a Windows BAT script you'll need to change the single percent signs "%" to doubles "%%".