问题
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