magick animation subplot

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
mattfack
Posts: 3
Joined: 2018-10-08T07:39:01-07:00
Authentication code: 1152

magick animation subplot

Post by mattfack »

Hi everyone,

I am using ImageMagick 7.0.8-12 Q16 x86_64 2018-09-23.

I usually mount pngs into one gif with

Code: Select all

magick @fileorder.txt mygif.gif
Now I would like to duplicate that command, i.e. have two gifs one above the other synchronized.
Can I animate two sets of pngs one above the other?

As an example you have a typical folder/subfolder structure here [1] with pngs and txts.

The result should be something similar to the procedure explained here [2] but should be simpler if one could already combine the pngs without converting gifs to single figures.

Thanks

[1] https://www.dropbox.com/sh/32ymutc2e1yc ... zjOWa?dl=0

[2] https://www.imagemagick.org/Usage/anim_mods/#append
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Double gif

Post by snibgo »

IM can make an animated GIF from a list of individual frames. On your case, each frame comes from two sources.

The easiest way may be a script, but I expect it can be done in a single magick command, thus: read the first fileorder.txt, then NULL:, then the second list. Now we have two lists, and you can append them pairwise with "-compose Append -layers composite". See http://www.imagemagick.org/script/comma ... php#layers

However, sadly, IM doesn't have "-compose Append". If all the images have the same dimensions, and the size of the output frames is (say) 200x300, then:

Code: Select all

magick @list1.txt -gravity North -extent 200x300 NULL: @list2.txt  -compose Over -gravity South -layers composite out.gif
snibgo's IM pages: im.snibgo.com
mattfack
Posts: 3
Joined: 2018-10-08T07:39:01-07:00
Authentication code: 1152

Re: magick animation subplot

Post by mattfack »

Thanks snibgo, your solution works perfectly, and it is also very fast.

The alternative I came up with was to use a script to

1. append the png images creating a new composed png
2. animate the new pngs
3. remove the generated pngs

Cheers
Post Reply