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

Do not use background or transparency index for new color #5564

Merged
merged 2 commits into from Jun 30, 2021

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Jun 29, 2021

Resolves #4202

When the code from that issue calls getcolor() to find a new color to draw with, it picks 255. However, the image from that issue has an info["transparency"] of 255. So Pillow draws with the transparency index, which produces unexpected results.

This PR skips the background and transparency index when calling getcolor() to prevent this.

Tests/test_imagepalette.py Outdated Show resolved Hide resolved
hugovk
hugovk approved these changes Jun 30, 2021
@radarhere radarhere merged commit 1b74bdd into python-pillow:master Jun 30, 2021
50 of 51 checks passed
@radarhere radarhere deleted the getcolor branch Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants