Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > e5936adde9b1ea7ed6dc23c107bda8ab > files > 108

python3-pillow-doc-5.4.1-1.1.mga7.noarch.rpm

.. py:module:: PIL.ImageSequence
.. py:currentmodule:: PIL.ImageSequence

:py:mod:`ImageSequence` Module
==============================

The :py:mod:`ImageSequence` module contains a wrapper class that lets you
iterate over the frames of an image sequence.

Extracting frames from an animation
-----------------------------------

.. code-block:: python

    from PIL import Image, ImageSequence

    im = Image.open("animation.fli")

    index = 1
    for frame in ImageSequence.Iterator(im):
        frame.save("frame%d.png" % index)
        index += 1

The :py:class:`~PIL.ImageSequence.Iterator` class
-------------------------------------------------

.. autoclass:: PIL.ImageSequence.Iterator