Add image to end of gif
-
- Posts: 4
- Joined: 2015-05-26T11:37:53-07:00
- Authentication code: 6789
Add image to end of gif
I need help or a nudge in the right direction. I am trying to take a gif (animated.gif) and add an image (extra.png) to the end of that gif. What command am I looking for? Any help would be great.
-
- Posts: 4
- Joined: 2015-05-26T11:37:53-07:00
- Authentication code: 6789
Re: Add image to end of gif
I think I figured it out after having an epiphany.
I just used to convert command.
convert -delay 50 @fileList.txt animated.gif where fileList contains the lines
animated.gif
extra.png
Is this the most efficient way to do this?
I just used to convert command.
convert -delay 50 @fileList.txt animated.gif where fileList contains the lines
animated.gif
extra.png
Is this the most efficient way to do this?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Add image to end of gif
You can do it more directly:
This reads in all the frames in animated.gif. Then it reads the image in extra.png. Then it writes all the images to animated.gif.
When testing, you should write to a different filename, eg animated2.gif.
Code: Select all
convert -delay 50 animated.gif extra.png animated.gif
When testing, you should write to a different filename, eg animated2.gif.
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2015-05-26T11:37:53-07:00
- Authentication code: 6789
Re: Add image to end of gif
Thank you for the testing advice. Do you know if this method I came to is the best way to do the action?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Add image to end of gif
In ImageMagick, it's the only way (as far as I know).
You might need an extra step. Many animated GIFs are optimized, which means each frame stores only the difference from the previous frame. So it is generally better to do this:
"-layers coalesce" makes each image the full picture, rather than just the pixels that have changed. You might want to optimise the result:
You might need an extra step. Many animated GIFs are optimized, which means each frame stores only the difference from the previous frame. So it is generally better to do this:
Code: Select all
convert -delay 50 animated.gif -layers coalesce extra.png animated.gif
Code: Select all
convert -delay 50 animated.gif -layers coalesce extra.png -layers optimize animated.gif
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2015-05-26T11:37:53-07:00
- Authentication code: 6789
Re: Add image to end of gif
Thank you for all of the help!