Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

If first GIF frame has transparency for RGB_ALWAYS loading strategy, use RGBA mode

Open radarhere opened this issue 3 years ago • 0 comments

Resolves #6590

At the moment, the first frame of a GIF is never RGBA. https://github.com/python-pillow/Pillow/blob/b8d96246f71753cbd8aaafc6dc633cad3aad0317/src/PIL/GifImagePlugin.py#L302-L308

This PR changes it to be RGBA if there is transparency and LoadingStrategy.RGB_ALWAYS is used. In that situation, transparency should not be set in the info dictionary, because the transparency is a palette index, and the image is in RGBA mode.

radarhere avatar Sep 17 '22 08:09 radarhere