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

Only prevent repeated polygon pixels when drawing with transparency #5835

Merged
merged 2 commits into from Nov 16, 2021

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Nov 15, 2021

#4333 prevented polygon pixels from being drawn more than once, so that the transparencies of pixels would not be combined to create an unintended result.

However, #5700 reported that this results in a speed decrease.

This PR switches back to the earlier, faster method of drawing pixels repeatedly - when drawing without transparency. This means that the slower method to avoid the transparency problem is not used when it does not need to be used.

@ntninja
Copy link

@ntninja ntninja commented Nov 15, 2021

Thank you! I will test this shortly and report back!

@ntninja
Copy link

@ntninja ntninja commented Nov 15, 2021

I can confirm this works in our setup, thank you!

@hugovk
Copy link
Member

@hugovk hugovk commented Nov 15, 2021

@ntninja Thank you for testing!

@radarhere Thank you for the PR! Can we add tests to cover the (hasAlpha == 1) branch?

@radarhere
Copy link
Member Author

@radarhere radarhere commented Nov 16, 2021

Ah, I had presumed that the test from #4333 would still cover this situation, but #4523 changed ellipses so that they are no longer polygons.

Ok, I've added a test.

@hugovk
Copy link
Member

@hugovk hugovk commented Nov 16, 2021

Thanks both!

@hugovk hugovk merged commit 2849347 into python-pillow:main Nov 16, 2021
49 of 51 checks passed
@radarhere radarhere deleted the alpha branch Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants