蒙太奇一起五个 gif

5 command-line video image-manipulation

我有五个 gif,它们都具有相同的帧数和相同的帧率。是否可以将这些蒙太奇组合成一个 gif,其中每一帧类似于静态图像的正常蒙太奇,并且是 gif 中的下一帧。此外,我想要第一行的前两个 gif,然后是一个空格,然后是最后三个 gif。

Mar*_*erg 11

如果我理解正确的话,您想要一个看起来像 5 个并行播放的 gif 动画的 gif 动画,对吗?

Imagemagick可以做到这一点(以及更多)。甚至可能在一行代码中,但我会分几个步骤来完成。让我们假设您的 gif 被称为anim1.gif……anim5.gif并且每个 100x100 像素。

#Combine anim1.gif and anim2.gif (first row)
convert anim1.gif -repage 200x100 -coalesce null: \( anim2.gif -coalesce \) -geometry +100+0 -layers Composite anim1+2.gif
#Combine anim3.gif and anim4.gif (1st part of last row)
convert anim3.gif -repage 200x100 -coalesce null: \( anim4.gif -coalesce \) -geometry +100+0 -layers Composite anim3+4.gif
#Combine anim3+4.gif and anim5.gif (last row)
convert anim3+4.gif -repage 300x100 -coalesce null: \( anim5.gif -coalesce \) -geometry +200+0 -layers Composite anim3+4+5.gif
#Combine all, leaving one in the middle empty
convert anim1+2.gif -repage 300x300 -coalesce null: \( anim3+4+5.gif -coalesce \) -geometry +0+200 -layers Composite anim_all.gif
Run Code Online (Sandbox Code Playgroud)

此处更详细地描述了该技术(“分层组合”)

最终结果(来自 imagemagick 网页的动画示例)如下所示: 动画 gif