-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix: Change alpha application for RGBA from overwrite to multiply #30523
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
Conversation
rcomer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work on this @LangQi99 and sorry you did not get a response sooner. The fix looks right to me. However, this is a breaking change, as shown by the modified test. I do not think we can reasonably provide a deprecation pathway for this, but it should have an API change note.
| (im_rgb, | ||
| (scalar_alpha * array_alpha).reshape((ny, nx, 1))), | ||
| axis=-1), | ||
| interpolation_stage=intp_stage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a style-only change. Please revert.
|
I'm not working on this currently. Feel free to close it. |


PR summary
Closes #26092
Per community consensus in #26092, the behavior for RGBA inputs has been changed from overwriting to blending; the image's intrinsic alpha is now multiplied with the passed alpha value. This change unifies alpha handling for 2D, RGB, and RGBA images, making the behavior consistent and predictable.
PR checklist