From 39acc4478f959dd9aaad5d80e5aab471272ede06 Mon Sep 17 00:00:00 2001 From: gofr <32750931+gofr@users.noreply.github.com> Date: Sun, 7 Feb 2021 17:36:22 +0100 Subject: [PATCH] Refer to quantization method docs in Image.quantize() All quantization methods are already documented in a dedicated section. Don't duplicate that information in the documentation of Image.quantize(). Link to the existing section. --- docs/reference/Image.rst | 6 ++++-- src/PIL/Image.py | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/reference/Image.rst b/docs/reference/Image.rst index f0a368479..92481f59a 100644 --- a/docs/reference/Image.rst +++ b/docs/reference/Image.rst @@ -479,6 +479,8 @@ Used to specify the pallete to use for the :meth:`~Image.convert` method. .. data:: WEB .. data:: ADAPTIVE +.. _quantization-methods: + Quantization methods ^^^^^^^^^^^^^^^^^^^^ @@ -486,11 +488,11 @@ Used to specify the quantization method to use for the :meth:`~Image.quantize` m .. data:: MEDIANCUT - Median cut + Median cut. RGBA not supported. .. data:: MAXCOVERAGE - Maximum coverage + Maximum coverage. RGBA not supported. .. data:: FASTOCTREE diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 369bab753..b9150308e 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1054,9 +1054,8 @@ class Image: :param colors: The desired number of colors, <= 256 :param method: :data:`MEDIANCUT` (default), - :data:`MAXCOVERAGE`, - :data:`FASTOCTREE` (default for RGBA images), - :data:`LIBIMAGEQUANT`. + :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`.