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 2 commits into from Jun 30, 2021


Copy link

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/ Outdated Show resolved Hide resolved
@hugovk hugovk added the automerge Automatically merge PRs that are ready label Jun 30, 2021
@radarhere radarhere merged commit 1b74bdd into python-pillow:master Jun 30, 2021
@radarhere radarhere deleted the getcolor branch June 30, 2021 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
automerge Automatically merge PRs that are ready Palette
None yet

Successfully merging this pull request may close these issues.

Odd color change in GIF after overlaying text
2 participants