Writing animated gif using Wand and ImageMagick

送分小仙女□ 提交于 2019-12-23 14:38:51

问题


I'm having trouble figuring out how to write a basic sequence to an animated gif using Wand the ImageMagick binding.

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

回答1:


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)


来源:https://stackoverflow.com/questions/17394869/writing-animated-gif-using-wand-and-imagemagick

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!