mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 00:32:27 +03:00
Removed duplicate open duration, clarified, listed all save options, added tuple for duration
This commit is contained in:
parent
e530f2a228
commit
55e068d52e
|
@ -72,9 +72,6 @@ The :py:meth:`~PIL.Image.Image.open` method sets the following
|
||||||
**background**
|
**background**
|
||||||
Default background color (a palette color index).
|
Default background color (a palette color index).
|
||||||
|
|
||||||
**duration**
|
|
||||||
Time between frames in an animation (in milliseconds).
|
|
||||||
|
|
||||||
**transparency**
|
**transparency**
|
||||||
Transparency color index. This key is omitted if the image is not
|
Transparency color index. This key is omitted if the image is not
|
||||||
transparent.
|
transparent.
|
||||||
|
@ -83,8 +80,8 @@ The :py:meth:`~PIL.Image.Image.open` method sets the following
|
||||||
Version (either ``GIF87a`` or ``GIF89a``).
|
Version (either ``GIF87a`` or ``GIF89a``).
|
||||||
|
|
||||||
**duration**
|
**duration**
|
||||||
May not be present. The time to display each frame of the GIF, in
|
May not be present. The time to display the current frame
|
||||||
milliseconds.
|
of the GIF, in milliseconds.
|
||||||
|
|
||||||
**loop**
|
**loop**
|
||||||
May not be present. The number of times the GIF should loop.
|
May not be present. The number of times the GIF should loop.
|
||||||
|
@ -98,22 +95,37 @@ the file by seeking to the first frame. Random access is not supported.
|
||||||
|
|
||||||
``im.seek()`` raises an ``EOFError`` if you try to seek after the last frame.
|
``im.seek()`` raises an ``EOFError`` if you try to seek after the last frame.
|
||||||
|
|
||||||
Saving sequences
|
Saving
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
When calling :py:meth:`~PIL.Image.Image.save`, if a multiframe image is used,
|
When calling :py:meth:`~PIL.Image.Image.save`, the following options
|
||||||
by default only the first frame will be saved. To save all frames, the
|
are available::
|
||||||
``save_all`` parameter must be present and set to ``True``. To append
|
|
||||||
additional frames when saving, the ``append_images`` parameter works with
|
|
||||||
``save_all`` to append a list of images containing the extra frames::
|
|
||||||
|
|
||||||
im.save(out, save_all=True, append_images=[im1, im2, ...])
|
im.save(out, save_all=True, append_images=[im1, im2, ...])
|
||||||
|
|
||||||
If present, the ``loop`` parameter can be used to set the number of times
|
**save_all**
|
||||||
the GIF should loop, and the ``duration`` parameter can set the number of
|
If present and true, all frames of the image will be saved. If
|
||||||
milliseconds between each frame. The ``duration`` parameter can be either an
|
not, then only the first frame of a multiframe image will be saved.
|
||||||
integer or a list of integers. Passing a list to the ``duration``parameter
|
|
||||||
will set the ``duration`` of each frame respectively.
|
**append_images**
|
||||||
|
A list of images to append as additional frames. Each of the
|
||||||
|
images in the list can be single or multiframe images.
|
||||||
|
|
||||||
|
**duration**
|
||||||
|
The display duration of each frame of the multiframe gif, in
|
||||||
|
milliseconds. Pass a single integer for a constant duration, or a
|
||||||
|
list or tuple to set the duration for each frame separately.
|
||||||
|
|
||||||
|
**loop**
|
||||||
|
Integer number of times the GIF should loop.
|
||||||
|
|
||||||
|
**optimize**
|
||||||
|
If present and true, attempt to compress the palette by
|
||||||
|
eliminating unused colors. This is only useful if the palette can
|
||||||
|
be compressed to the next smaller power of 2 elements.
|
||||||
|
|
||||||
|
**palette**
|
||||||
|
Use the specified palette for the saved image.
|
||||||
|
|
||||||
Reading local images
|
Reading local images
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Reference in New Issue
Block a user