mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
Merge pull request #1020 from wiredfool/quantize
Docstring for Image.quantize. [ci skip]
This commit is contained in:
commit
3052d4909c
19
PIL/Image.py
19
PIL/Image.py
|
@ -940,14 +940,19 @@ class Image:
|
||||||
return new_im
|
return new_im
|
||||||
|
|
||||||
def quantize(self, colors=256, method=None, kmeans=0, palette=None):
|
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()
|
self.load()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user