wand.sequence — Sequences

New in version 0.3.0.

class wand.sequence.Sequence(image)

The list-like object that contains every SingleImage in the Image container. It implements collections.Sequence protocol.

New in version 0.3.0.

append(image)

S.append(object) – append object to the end of the sequence

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(**kwds)

Scoped setter of current_index. Should be used for with statement e.g.:

with image.sequence.index_context(3):
    print(image.size)

Note

It’s only for internal use.

insert(index, image)

S.insert(index, object) – insert object before index

class wand.sequence.SingleImage(wand, container, c_original_resource)

Each single image in Image container. For example, it can be a frame of GIF animation.

Note that all changes on single images are invisible to their containers until they are close()d (destroy()ed).

New in version 0.3.0.

container = None

(wand.image.Image) The container image.

delay

(numbers.Integral) The delay to pause before display the next image (in the sequence of its container). It’s hundredths of a second.

destroy()

Cleans up the resource explicitly. If you use the resource in with statement, it was called implicitly so have not to call it.

index

(numbers.Integral) The index of the single image in the container image.