Skip to content

Commit

Permalink
Corrected "optimize" default when saving GIF images
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 25, 2023
1 parent 04a4d54 commit c855584
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/handbook/image-file-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,12 @@ following options are available::
:py:class:`PIL.ImagePalette.ImagePalette` object.

**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.
Whether to attempt to compress the palette by eliminating unused colors.
This is attempted by default, unless a palette is specified as an option or
as part of the first image's :py:attr:`~PIL.Image.Image.info` dictionary.

This is only useful if the palette can be compressed to the next smaller
power of 2 elements.

Note that if the image you are saving comes from an existing GIF, it may have
the following properties in its :py:attr:`~PIL.Image.Image.info` dictionary.
Expand Down

0 comments on commit c855584

Please sign in to comment.