4

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
brasofilo
  • 25,496
  • 15
  • 91
  • 179
jkeilson
  • 85
  • 1
  • 6

1 Answers1

-3

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)
jkeilson
  • 85
  • 1
  • 6
  • 2
    Using os.system means a another process is triggered and executed outside of the host process (Python). Your own question is about how to use ImageMagick via Wand as a binding. – Khanh Hua Nov 05 '15 at 23:23
  • 1
    Exactly—I also would very much like to know how to do this directly in Wand and not a command-line hack. I asked basically the same question from a different angle and with a comparison of how (easily) it works in RMagick+Ruby: http://stackoverflow.com/questions/39939780/how-do-i-create-an-animated-gif-in-python-using-wand – Dominick Oct 09 '16 at 18:55