Skip to content

Conversation

radarhere
Copy link
Member

Resolves #8222

In the issue, two RGBA images are saved together in the GIF format. However, the transparent background is (0, 0, 0, 0) and (0, 0, 0) is also re-used at different opacities within the image. When GifImagePlugin tries to optimise the image by utilising remap_palette() to group multiple colours together, it doesn't consider the A channel, and so an unexpected result occurs, where the colour information for the bottom line of the second image is lost, and then cropped out.

By improving the detection of RGBA palettes, this is fixed.

@radarhere radarhere added the GIF label Sep 10, 2024
@hugovk hugovk merged commit 302b63f into python-pillow:main Sep 10, 2024
47 of 48 checks passed
@radarhere radarhere deleted the gif_rgba branch September 10, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GIF optimizer acts wrongly with black pixels when disposal=2

2 participants