From 24054d8fccbdbf50f87fb50655585b64cd7d5ab6 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 30 Mar 2022 07:29:23 +1100 Subject: [PATCH] Document how to restore original setting --- docs/handbook/image-file-formats.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 62f4d101d..c8568719c 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -129,6 +129,12 @@ available:: from PIL import GifImagePlugin GifImagePlugin.LOADING_STRATEGY = GifImagePlugin.LoadingStrategy.RGB_AFTER_DIFFERENT_PALETTE_ONLY +To restore the default behavior, where ``P`` mode images are only converted to +``RGB`` or ``RGBA`` after the first frame:: + + from PIL import GifImagePlugin + GifImagePlugin.LOADING_STRATEGY = GifImagePlugin.LoadingStrategy.RGB_AFTER_FIRST + The :py:meth:`~PIL.Image.open` method sets the following :py:attr:`~PIL.Image.Image.info` properties: