Page 1 of 1

combine .png and .gif

Posted: 2015-06-10T11:13:27-07:00
by Mattdk
Hey everybody,
I would be very pleased if anybody could help.

I am trying to create a new image with two .png and one animated .gif in the middle. So the resulting gif should look like this:

image1.png my_gif.gif image2.png

The images on the left and on the right are fix and the gif in the middle should be animated


I tried with convert and montage but either it does not work at all or it creats a strip consisting of all images (also the 10 images which creates the .gif)


I am very thankfull for your answers!!!
Best Matt

Re: combine .png and .gif

Posted: 2015-06-10T11:31:33-07:00
by snibgo
An image might be a png, or it might be a gif. It can't be both at once.

You could make a gif where each frame comes from an append of image1.png and a frame from my_gif.gif and image2.png. I'm not sure if that can be done in a single command.

Re: combine .png and .gif

Posted: 2015-06-10T12:32:04-07:00
by fmw42
I believe that you can combine all the images into a new gif animation. Try something like

Code: Select all

convert \( -delay 500 firstpngimage.png \) \( -delay 20 gifanimation.gif -coalesce \) \( -delay 500 lastpngimage.png \) -loop 0 newgifanimation.gif

Re: combine .png and .gif

Posted: 2015-06-11T04:35:45-07:00
by Mattdk
Thanks very much for your advices.
It did not work the way I want it to, but I figured out an other way (a little bit a more time intensive way, but it worked;-) )

I first made my 48 strips:
convert fix_image_1.png frame_1.png fix_image_2.png +append animation_1.png \
convert fix_image_1.png frame_2.png fix_image_2.png +append animation_2.png \ and so on....

then I made the loops to create the animated gif.
convert -delay 10 animation_1.png animation_2.png (.....) -loop 0 endversion.gif