From 4eccadced48fa1399ee2e3a2afcebbf8b57e5d5f Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 9 Jan 2021 21:30:16 +1100 Subject: [PATCH] Document that getcolors() returns colors in the image mode [ci skip] --- src/PIL/Image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index e2540a2b2..db1c70239 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1243,6 +1243,10 @@ class Image: """ Returns a list of colors used in this image. + The colors will be in the image's mode. For example, an RGB image will + return a tuple of (red, green, blue) color values, and a P image will + return the index of the color in the palette. + :param maxcolors: Maximum number of colors. If this number is exceeded, this method returns None. The default limit is 256 colors.