Documented default quantization method

This commit is contained in:
Andrew Murray 2021-03-22 19:18:36 +11:00
parent aa35f6b572
commit ab56edb49f
2 changed files with 8 additions and 3 deletions

View File

@ -486,15 +486,15 @@ 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.
.. data:: MAXCOVERAGE
Maximum coverage
Maximum coverage.
.. data:: FASTOCTREE
Fast octree
Fast octree. Default method for RGBA images.
.. data:: LIBIMAGEQUANT

View File

@ -1059,6 +1059,11 @@ class Image:
: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. RGBA images use
:data:`FASTOCTREE` by default instead.
:param kmeans: Integer
:param palette: Quantize to the palette of given
:py:class:`PIL.Image.Image`.