使用 ImageMagick 将图像组合成一行
我有大约 650 个带有精灵的 gif
文件,但我无法在 中显示它们的动画,因此我需要将它们转换为精灵表,每个动画转换为单个
png
。
很明显为什么我不想和 Gimp 一起手工完成这一切。我找到了一种将 gif
的帧提取到单个文件中的方法:
convert image.gif -depth 32 /tmp/frames%02d.png
非常简单,但我遇到了一个问题:现在我想制作一个 png
出来其中,排成一排。我怎样才能正确地组合它们?
如果有人能帮助我那就太好了。
编辑:我自己发现了如何保持透明度。
I have about 650 gif
files with sprites, but I can't display them animated in a <canvas>
, so I would need to turn them into spritesheets, every animation into a single png
.
It's obvious why I don't want to do all this by hand with Gimp. I have found a way to extract the frames of the gif
into individual files:
convert image.gif -depth 32 /tmp/frames%02d.png
Very simple, but I am stuck with a problem: Now I want to make a single png
out of them, in one row. How can I compose them correctly?
It'd be great if anyone could help me.
EDIT: Found out how to preserve transparency myself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
秘密在于
-append
选项:效果很好。
The secret is the
-append
option:Works nicely.