Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When saving RGBA to GIF, make use of first transparent palette entry #5859

Merged
merged 1 commit into from Dec 28, 2021

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Nov 30, 2021

Helps #4640

When saving an image as a GIF, the image passes through _normalize_mode, to convert the image to 1, L or P.

When saving a single RGBA image as a GIF, the transparency is currently lost. This PR fixes that by setting the "transparency" key in the info dictionary to the first transparent palette entry (if you think that might not be very effective, since there could be many different transparent palette entries, remember #5282).

@radarhere radarhere added the GIF label Nov 30, 2021
@radarhere radarhere changed the title When saving RGBA GIF, make use of first transparent palette entry When saving RGBA as GIF, make use of first transparent palette entry Nov 30, 2021
@radarhere radarhere changed the title When saving RGBA as GIF, make use of first transparent palette entry When saving RGBA to GIF, make use of first transparent palette entry Nov 30, 2021
@hugovk hugovk merged commit f560707 into python-pillow:main Dec 28, 2021
49 checks passed
@radarhere radarhere deleted the saving_rgba_gif branch Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants