Skip to content

Commit

Permalink
Merge pull request #5197 from radarhere/getcolors
Browse files Browse the repository at this point in the history
getcolors() returns colors in the image mode
  • Loading branch information
hugovk committed Jan 9, 2021
2 parents 3dd8c98 + 4eccadc commit e406bd5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,10 @@ def getcolors(self, maxcolors=256):
"""
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.
Expand Down

0 comments on commit e406bd5

Please sign in to comment.