Merged
Conversation
added 4 commits
July 4, 2022 19:45
Should simplify working with the BLEND_PREMULTIPLIED blend mode.
Starbuck5
reviewed
Jul 10, 2022
Contributor
Author
|
I added a bit more information to the documentation. I have a task to make a larger tutorial on pre-multiplied alpha as well to try and explain how to use it with some worked examples. |
Contributor
|
If you call premul-alpha on a surface twice, will the first second result be different from the first? |
Contributor
Author
|
Yes, the output surface will be different because you will multiply by the
alpha again.
I considered flagging a surface after alpha multiplying, but since we can't
do that for loaded surfaces, or constructed in pygame by the user surfaces
(there is no difference between a surface with the intent that it is alpha
multiplied and an identical one where this isn't intended), it seemed like
it would just make it more confusing.
Alpha premultiplication is essentially all about the users blitting intent
rather than something inherent to the pixels.
…On Wed, 13 Jul 2022, 07:54 Charlie Hayden, ***@***.***> wrote:
If you call premul-alpha on a surface twice, will the first second result
be different from the first?
—
Reply to this email directly, view it on GitHub
<#3276 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGDGGQX4I3ZYP4KTGIJGTTVTZR23ANCNFSM52T6ZRLA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Maybe add this to the docs? |
Contributor
Author
I can do. |
added 6 commits
July 18, 2022 19:32
# Conflicts: # src_c/simd_blitters.h
# Conflicts: # src_c/alphablit.c # src_c/simd_blitters_sse2.c # src_c/surface.h
Starbuck5
reviewed
Nov 7, 2022
Starbuck5
reviewed
Nov 7, 2022
Starbuck5
approved these changes
Nov 7, 2022
Contributor
Starbuck5
left a comment
There was a problem hiding this comment.
Left a couple minor things to do before merge, but otherwise I couldn't find anything wrong in the PR. Nice job!
JoKing-1999
approved these changes
Dec 11, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should simplify working with the BLEND_PREMULTIPLIED blend mode.
This is an adaption and simplification of an old PR I had lying around. If I get some time before the 2.1.4 release, I will add an AVX2 version of the pre-multiplication - though it's not critical as this shouldn't normally be a critical path function like blit.
I also now kind of want to work up a little BEFORE and AFTER demo program showing how to use the same assets in the old school (normal alpha blending, blits()) way versus the new-ish (premul_alpha(), BLEND_PREMULTIPLED, ublits() - maybe threaded blitting?) way.