wand.sequence — Sequences¶
New in version 0.3.0.
-
class
wand.sequence.Sequence(image)¶ The list-like object that contains every
SingleImagein theImagecontainer. It implementscollections.abc.Sequenceprotocol.New in version 0.3.0.
-
append(image)¶ S.append(value) – append value to the end of the sequence
-
property
current_index¶ (
numbers.Integral) The current index of its internal iterator.Note
It’s only for internal use.
-
extend(images, offset=None)¶ S.extend(iterable) – extend sequence by appending elements from the iterable
-
index_context(index)¶ Scoped setter of
current_index. Should be used forwithstatement e.g.:with image.sequence.index_context(3): print(image.size)
Note
It’s only for internal use.
-
insert(index, image)¶ S.insert(index, value) – insert value before index
-
-
class
wand.sequence.SingleImage(wand, container, c_original_resource)¶ Each single image in
Imagecontainer. For example, it can be a frame of GIF animation.Note that all changes on single images are invisible to their containers unless they are altered a
with ...context manager.- with Image(filename=’animation.gif’) as container:
- with container.sequence[0] as frame:
frame.negate()
New in version 0.3.0.
Changed in version 0.5.1: Only sync changes of a
SingleImagewhen exiting awith ...context. Not when parentImagecloses.-
container= None¶ (
wand.image.Image) The container image.