如何使用ImageMagick将背景放在动画,渲染的前景下

发布于 2025-01-29 10:29:00 字数 863 浏览 3 评论 0原文

我有一些具有透明背景的动画行星(在大多数观看者中为格式),并想在他们身后放置一个背景之星字段,例如:

“星球上的星球”

我目前我目前在图像后面呈现一架平坦的平面, Star JPEG映射为纹理,但我想避免的问题。我不希望一个对象回到那里,我只是想要一个静态背景(实际对象会导致阴影,摄像头,照明等复杂性)

我正在尝试使用这样的各种成像命令,但似乎没有任何作用。他们要么完全杀死动画(使其成为静止图像),要么每个动画周期一次闪烁背景,并显示其余帧的方格背景。

convert animated_planet.gif stars2.jpg -composite planet_with_background.gif

”背景我想要每个帧“

I have some rendered, animated planets with a transparent background (checkered in most viewers) and want to put a background star field behind them, like this:

Planet over Stars

I'm currently rendering a flat plane behind the image with the star jpeg mapped as a texture but that's got problems I want to avoid. I don't want an object back there, I just want a static background (an actual object causes complexity with shadows, camera angles, lighting etc)

I'm trying various ImageMagic commands like this but nothing seems to work. They either kill the animation entirely (make it a still image) or flash the background once per cycle of the animation and display the checkered background for the remaining frames.

convert animated_planet.gif stars2.jpg -composite planet_with_background.gif

animated with transparent background

Background I want under every frame

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

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

发布评论

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

评论(1

摘星┃星的人 2025-02-05 10:29:00

发布您的前景和背景图像。在ImageMagick中,您可以在一个具有透明度的动画下放置一个恒定的背景,如下所示,假设imagemagick 6。

convert animation.gif -coalesce null: background.suffix -compose dstOver -layers composite -layers optimize new_animation.gif

如果在ImageMagick 7上,后缀为您的背景图像后缀(JPG,PNG,GIF等)

,则替换转换>转换> convert带有magick

请参阅

https://legacy.imagacy.imagemagick.org/usage/usage/usage/usage /anim_mods/#背景

加法:

这对我有效6.9.12-49 Q16 Mac OSX Monterey。

convert animation.gif -coalesce null: background.jpg -compose dstOver -layers composite -layers optimize new_animation.gif

或者要稍微放慢一点:

convert -delay 20 animation.gif -coalesce null: background.jpg -compose dstOver -layers composite -layers optimize -loop 0 new_animation2.gif

https://i.sstatic.net/qsf6r.gif“ alt =”在此处输入图像描述”>

Post your foreground and background images. In Imagemagick, you can put a constant background under an animation that has transparency as follows assuming Imagemagick 6.

convert animation.gif -coalesce null: background.suffix -compose dstOver -layers composite -layers optimize new_animation.gif

where suffix is your background image suffix (JPG, PNG, GIF etc)

If on Imagemagick 7, replace convert with magick

See

https://legacy.imagemagick.org/Usage/anim_mods/#background

ADDITION:

This works fine for me on IM 6.9.12-49 Q16 Mac OSX Monterey.

convert animation.gif -coalesce null: background.jpg -compose dstOver -layers composite -layers optimize new_animation.gif

enter image description here

Or if you want to slow it down a bit:

convert -delay 20 animation.gif -coalesce null: background.jpg -compose dstOver -layers composite -layers optimize -loop 0 new_animation2.gif

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文