Stitch two (2) animated gifs together, side by side

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mikebikeboy
Posts: 4
Joined: 2013-05-08T16:21:35-07:00
Authentication code: 6789

Stitch two (2) animated gifs together, side by side

Post by mikebikeboy »

Hi Everyone

I'm new here. I have been given the task of stitching 3 animated gifs together, all side-by-side. Is this possible with Imagemagick? The original images would live on a webserver and the final rendering would live on the webserver as well. PHP would be the scripting language.

Any help appreciated. I thought I'd ask before investing more time in looking for a solution.

Thanks!!!

mikebikeboy
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Stitch two (2) animated gifs together, side by side

Post by GreenKoopa »

This is possible with IM. Do the animations have the same number and timing of their frames?

Animation Basics:
http://www.imagemagick.org/Usage/anim_basics/

PHP interfaces:
http://imagemagick.org/script/api.php#php
mikebikeboy
Posts: 4
Joined: 2013-05-08T16:21:35-07:00
Authentication code: 6789

Re: Stitch two (2) animated gifs together, side by side

Post by mikebikeboy »

If it's necessary, they can have the same timing and # of frames.
mikebikeboy
Posts: 4
Joined: 2013-05-08T16:21:35-07:00
Authentication code: 6789

Re: Stitch two (2) animated gifs together, side by side

Post by mikebikeboy »

Hey, thanks for the info! I'm looking throught PHP documentation and it appears to have the methods I need. I should have looked there before posting, but I was at the end of my rope, I've been searching for a solution to this all day. Thanks again.
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Stitch two (2) animated gifs together, side by side

Post by GreenKoopa »

Fair enough to ask if something is possible or for direction to further reading. I don't have much experience with animations, so I can't offer much more anyway. That said, stitching two animations together must mean stitching frames together. Each merged frame would have a single color table, timing, disposal method, etc. If these already match, this is an easy project. The more these are mismatched, the harder this is using any tool.
mikebikeboy
Posts: 4
Joined: 2013-05-08T16:21:35-07:00
Authentication code: 6789

Re: Stitch two (2) animated gifs together, side by side

Post by mikebikeboy »

The animated gifs will be randomly nominated, and most likely will have completely different color tables. I will be able to control the timing of the frames though.

I'm just wondering if the method "Imagick::appendImages" is going to handle animated gifs or if it only works for regular images...If anybody knows, please let me know.. Otherwise, I'm on my way to find out and will post the results.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stitch two (2) animated gifs together, side by side

Post by fmw42 »

see http://www.imagemagick.org/Usage/anim_mods/#append

However, if the two animations have different colormaps, you may need to process each frame to contain only the colors you want.

see -remap
http://www.imagemagick.org/Usage/quantize/#remap
http://www.imagemagick.org/Usage/video/ (this example should be using -remap and not the older -map)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Stitch two (2) animated gifs together, side by side

Post by anthony »

See...
IM examples, Animation Modifications, Side by Side Appending (time synced)
http://www.imagemagick.org/Usage/anim_mods/#append

This goes thru 3 different ways you can append the images together.

Later examples goes into time synchronizing, and layering of animations
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply