mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 00:46:16 +03:00
Fully document PIL.ImageSequence
This commit is contained in:
parent
1a72ba260a
commit
f284c194ca
|
@ -14,15 +14,18 @@
|
|||
#
|
||||
|
||||
##
|
||||
# This class implements an iterator object that can be used to loop
|
||||
# over an image sequence.
|
||||
|
||||
class Iterator:
|
||||
"""
|
||||
This class implements an iterator object that can be used to loop
|
||||
over an image sequence.
|
||||
|
||||
##
|
||||
# Create an iterator.
|
||||
#
|
||||
# @param im An image object.
|
||||
You can use the ``[]`` operator to access elements by index. This operator
|
||||
will raise an :py:exc:`IndexError` if you try to access a nonexistent
|
||||
frame.
|
||||
|
||||
:param im: An image object.
|
||||
"""
|
||||
|
||||
def __init__(self, im):
|
||||
if not hasattr(im, "seek"):
|
||||
|
|
|
@ -86,14 +86,6 @@ can be found here.
|
|||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`ImageSequence` Module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: PIL.ImageSequence
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`ImageShow` Module
|
||||
-----------------------
|
||||
|
||||
|
|
27
docs/reference/ImageSequence.rst
Normal file
27
docs/reference/ImageSequence.rst
Normal file
|
@ -0,0 +1,27 @@
|
|||
.. 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 = index + 1
|
||||
|
||||
The :py:class:`~PIL.ImageSequence.Iterator` class
|
||||
-------------------------------------------------
|
||||
|
||||
.. autoclass:: PIL.ImageSequence.Iterator
|
|
@ -18,4 +18,5 @@ Reference
|
|||
ImagePalette
|
||||
ImagePath
|
||||
ImageQt
|
||||
ImageSequence
|
||||
../PIL
|
||||
|
|
Loading…
Reference in New Issue
Block a user