Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/reference/Image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,20 @@ Used to specify the pallete to use for the :meth:`~Image.convert` method.
.. data:: WEB
.. data:: ADAPTIVE

.. _quantization-methods:

Quantization methods
^^^^^^^^^^^^^^^^^^^^

Used to specify the quantization method to use for the :meth:`~Image.quantize` method.

.. data:: MEDIANCUT

Median cut
Median cut. RGBA not supported.

.. data:: MAXCOVERAGE

Maximum coverage
Maximum coverage. RGBA not supported.

.. data:: FASTOCTREE

Expand Down
9 changes: 3 additions & 6 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,12 +1053,9 @@ def quantize(self, colors=256, method=None, kmeans=0, palette=None, dither=1):
of colors.

:param colors: The desired number of colors, <= 256
:param method: :data:`MEDIANCUT` (median cut),
:data:`MAXCOVERAGE` (maximum coverage),
:data:`FASTOCTREE` (fast octree),
:data:`LIBIMAGEQUANT` (libimagequant; check support using
:py:func:`PIL.features.check_feature`
with ``feature="libimagequant"``).
:param method: :data:`MEDIANCUT` (default),
:data:`FASTOCTREE` (default for "RGBA" mode).
See :ref:`quantization-methods` for all available methods.
:param kmeans: Integer
:param palette: Quantize to the palette of given
:py:class:`PIL.Image.Image`.
Expand Down