Skip to content

Commit

Permalink
Merge pull request #6831 from radarhere/transparency_documentation
Browse files Browse the repository at this point in the history
Document "transparency" info key
  • Loading branch information
mergify[bot] authored Dec 29, 2022
2 parents f0b494e + a4baeda commit be949e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/handbook/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ the file format handler (see the chapter on :ref:`image-file-formats`). Most
handlers add properties to the :py:attr:`~PIL.Image.Image.info` attribute when
loading an image, but ignore it when saving images.

Transparency
------------

If an image does not have an alpha band, transparency may be specified in the
:py:attr:`~PIL.Image.Image.info` attribute with a "transparency" key.

Most of the time, the "transparency" value is a single integer, describing
which pixel value is transparent in a "1", "L", "I" or "P" mode image.
However, PNG images may have three values, one for each channel in an "RGB"
mode image, or can have a byte string for a "P" mode image, to specify the
alpha value for each palette entry.

Orientation
-----------

Expand Down

0 comments on commit be949e8

Please sign in to comment.