Skip to content

Commit

Permalink
Further explain GIF palettes combining
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 29, 2022
1 parent e22a439 commit 5fb1ff6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/handbook/image-file-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ GIF files are initially read as grayscale (``L``) or palette mode (``P``)
images. Seeking to later frames in a ``P`` image will change the image to
``RGB`` (or ``RGBA`` if the first frame had transparency).

``P`` mode images are changed to ``RGB`` because each frame of a GIF may
introduce up to 256 colors. Because ``P`` can only have up to 256 colors, the
image is converted to handle all of the colors.
``P`` mode images are changed to ``RGB`` because each frame of a GIF may contain
its own individual palette of up to 256 colors. When a new frame is placed onto a
previous frame, those colors may combine to exceed the ``P`` mode limit of 256
colors. Instead, the image is converted to ``RGB`` handle this.

If you would prefer the first ``P`` image frame to be ``RGB`` as well, so that
every ``P`` frame is converted to ``RGB`` or ``RGBA`` mode, there is a setting
Expand Down

0 comments on commit 5fb1ff6

Please sign in to comment.