Skip to content

Commit 8f1524e

Browse files
radarherehugovk
authored andcommitted
Updated documentation
1 parent bac4744 commit 8f1524e

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

docs/reference/ImagePalette.rst

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ represent the color palette of palette mapped images.
99

1010
.. note::
1111

12-
This module was never well-documented. It hasn't changed since 2001,
13-
though, so it's probably safe for you to read the source code and puzzle
14-
out the internals if you need to.
15-
1612
The :py:class:`~PIL.ImagePalette.ImagePalette` class has several methods,
1713
but they are all marked as "experimental." Read that as you will. The
1814
``[source]`` link is there for a reason.

src/PIL/ImagePalette.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ class ImagePalette:
2525
"""
2626
Color palette for palette mapped images
2727
28-
:param mode: The mode to use for the Palette. See:
28+
:param mode: The mode to use for the palette. See:
2929
:ref:`concept-modes`. Defaults to "RGB"
3030
:param palette: An optional palette. If given, it must be a bytearray,
31-
an array or a list of ints between 0-255 and of length ``size``
32-
times the number of colors in ``mode``. The list must be aligned
33-
by channel (All R values must be contiguous in the list before G
34-
and B values.) Defaults to 0 through 255 per channel.
35-
:param size: An optional palette size. If given, it cannot be equal to
36-
or greater than 256. Defaults to 0.
31+
an array or a list of ints between 0-255. The list must consist of
32+
all channels for one color followed by the next color (e.g. RGBRGBRGB).
33+
Defaults to an empty palette.
34+
:param size: An optional palette size. If given, an error is raised
35+
if ``palette`` is not of equal length.
3736
"""
3837

3938
def __init__(self, mode="RGB", palette=None, size=0):

0 commit comments

Comments
 (0)