使用ImageMagick在特定位置将动画gif通过静态PNG合并

发布于 2025-02-06 15:55:23 字数 393 浏览 5 评论 0原文

我设法在静态PNG上粘贴了动画gif,并从中获得了动画gif 这些来源带有以下命令。

convert canvas.png animation.gif test.gif

它有效,但是动画和画布共享左上角,这不是我想要的。 通过阅读一点,我发现我必须使用-composite选项或命令,但是我尚未找到要使用的正确语法的示例。 我尝试了一下:

 convert canvas.png   animation.gif -geometry +780+275  -composite test01.gif

它仅使用动画的第一帧给出静态图像。gif 我尝试了其他语法,但只是产生错误。

适应动画的正确方法是什么?

I have managed to paste an animated gif over a static png and obtained an animated gif from
those sources with the following command.

convert canvas.png animation.gif test.gif

and it works, but the animation and the canvas share the upper left corner, which is not what I want.
By reading a little I discovered that I have to use either the -composite option or the command, but I have not found examples of the right syntax to use.
I tried this:

 convert canvas.png   animation.gif -geometry +780+275  -composite test01.gif

which gives a static image with just the first frame of animation.gif
I tried other syntax but just produces errors.

What is the right way to accommodate the animation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虫児飞 2025-02-13 15:55:23

在ImageMagick中尝试以下内容。它需要一个特殊的零:操作员才能分离两个图像和 - 层次复合材料。另外,当使用-layers复合时,您必须使用-page或-set页面而不是 - 几何。以下是Unix语法。对于Windows,请在括号之前删除\。

convert canvas.png null:  \( animation.gif -coalese -set page +780+275 \) -layers composite -layers optimize test01.gif

Try the following in Imagemagick. It takes a special null: operator to separate the two images and -layer composite. Also you must use -page or -set page rather than -geometry when using -layers composite. The following is Unix syntax. For Windows, remove the \ before the parentheses.

convert canvas.png null:  \( animation.gif -coalese -set page +780+275 \) -layers composite -layers optimize test01.gif
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文