The instructions are simple enough in the Wand docs for reading a sequenced image (e.g. animated gif, icon file, etc.):
>>> from wand.image import Image
>>> with Image(filename='sequence-animation.gif') as image:
... len(image.sequence)
...but I'm not sure how to create one.
In Ruby this is easy using RMagick, since you have ImageList
s. (see my gist for an example.)
I tried creating an Image
(as the "container") and instantiating each SingleImage
with an image path, but I'm pretty sure that's wrong, especially since the constructor documentation for SingleImage
doesn't look for use by the end-user.
I also tried creating a wand.sequence.Sequence
and going from that angle, but hit a dead-end as well. I feel very lost.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…