Writing animated gif using Wand and ImageMagick
Asked Answered
D

1

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
Duodecimal answered 30/6, 2013 at 21:9 Comment(0)
D
-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)
Duodecimal answered 12/7, 2013 at 3:1 Comment(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.Chantal
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: #39940280Bloom

© 2022 - 2024 — McMap. All rights reserved.