Merge pull request #5352 from radarhere/quantize_documentation

This commit is contained in:
Hugo van Kemenade 2021-03-26 15:25:14 +02:00 committed by GitHub
commit 9b69d94082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -1059,6 +1059,12 @@ 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. :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`.