Skip to content

Commit

Permalink
Merge pull request #5352 from radarhere/quantize_documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Mar 26, 2021
2 parents d402112 + 0ff9879 commit 9b69d94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/reference/Image.rst
Expand Up @@ -486,15 +486,16 @@ Used to specify the quantization method to use for the :meth:`~Image.quantize` m

.. data:: MEDIANCUT

Median cut
Median cut. Default method, except for RGBA images. This method does not support
RGBA images.

.. data:: MAXCOVERAGE

Maximum coverage
Maximum coverage. This method does not support RGBA images.

.. data:: FASTOCTREE

Fast octree
Fast octree. Default method for RGBA images.

.. data:: LIBIMAGEQUANT

Expand Down
6 changes: 6 additions & 0 deletions src/PIL/Image.py
Expand Up @@ -1059,6 +1059,12 @@ def quantize(self, colors=256, method=None, kmeans=0, palette=None, dither=1):
:data:`LIBIMAGEQUANT` (libimagequant; check support using
:py:func:`PIL.features.check_feature`
with ``feature="libimagequant"``).
By default, :data:`MEDIANCUT` will be used.
The exception to this is RGBA images. :data:`MEDIANCUT` and
:data:`MAXCOVERAGE` do not support RGBA images, so
:data:`FASTOCTREE` is used by default instead.
:param kmeans: Integer
:param palette: Quantize to the palette of given
:py:class:`PIL.Image.Image`.
Expand Down

0 comments on commit 9b69d94

Please sign in to comment.