From af8588f34e82a08e94abcf37f021868ad78bb948 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 19 Nov 2014 14:26:07 -0800 Subject: [PATCH] Docstring for Image.quantize. [ci skip] --- PIL/Image.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/PIL/Image.py b/PIL/Image.py index d556df34c..fa6bf1031 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -939,14 +939,19 @@ class Image: return new_im def quantize(self, colors=256, method=None, kmeans=0, palette=None): + """ + Convert the image to 'P' mode with the specified number + of colors. + + :param colors: The desired number of colors, <= 256 + :param method: 0 = median cut + 1 = maximum coverage + 2 = fast octree + :param kmeans: Integer + :param palette: Quantize to the :py:class:`PIL.ImagingPalette` palette. + :returns: A new image - # methods: - # 0 = median cut - # 1 = maximum coverage - # 2 = fast octree - - # NOTE: this functionality will be moved to the extended - # quantizer interface in a later version of PIL. + """ self.load()