# `wand.sequence` — Sequences

Added 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.abc.Sequence` protocol.

  Added 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 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, value) – insert value 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 unless they are altered a `with ...` context manager.

  > with Image(filename=’animation.gif’) as container:
  >   with container.sequence[0] as frame:

  >     frame.negate()

  Added in version 0.3.0.

  Changed in version 0.5.1: Only sync changes of a `SingleImage` when exiting a `with ...` context. Not when parent `Image` closes.

  container = None

    (`wand.image.Image`) The container image.

  property delay

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

  property index

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

  property sequence

    The type of the None singleton.