使用Wand和ImageMagick编写动画gif [英] Writing animated gif using Wand and ImageMagick
本文介绍了使用Wand和ImageMagick编写动画gif的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法弄清楚如何使用 Wand ImageMagick绑定。
I'm having trouble figuring out how to write a basic sequence to an animated gif using Wand the ImageMagick binding.
我想在python中重现的基本转换ImageMagick命令:
The basic convert ImageMagick commands I'm looking to reproduce in python:
convert -delay 50 -size 500x500 xc:SkyBlue \
-page +5+10 /test/wizard.gif \
-page +62+50 test/wizard2.gif \
-loop 0 animation.gif
推荐答案
我毕竟,只需通过os.system()将命令传递给终端就可以解决这个问题:
I was able to figure this out after all, by just passing the commands to terminal via os.system():
build = '''convert -delay 30 -size 500x500 \
-page +0+0 /Users/jkeilson/desktop/photobooth/flower.jpg \
-page +0+0 /Users/jkeilson/desktop/photobooth/wizard2.gif \
-page +0+0 /Users/jkeilson/desktop/photobooth/flower.jpg \
-page +0+0 /Users/jkeilson/desktop/photobooth/wizard2.gif \
-loop 0 animation6.gif'''
os.system(build)
这篇关于使用Wand和ImageMagick编写动画gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文