Skip to content

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

Merged
radarhere merged 2 commits intopython-pillow:masterfrom
radarhere:getcolor
Jun 30, 2021
Merged

Do not use background or transparency index for new color#5564
radarhere merged 2 commits intopython-pillow:masterfrom
radarhere:getcolor

Conversation

@radarhere
Copy link
Copy Markdown
Member

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.

@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

Labels

automerge Automatically merge PRs that are ready Palette

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Odd color change in GIF after overlaying text

2 participants