You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REPLACE - the pixels entirely replace the others and don't utilize alpha (transparency) values
This is confusing to me, it feels like I cannot set alpha to 0 with it because the new alpha values would not be utilized according to the reference (?), but in fact I can set alpha to 0 with it. This is the desired REPLACE behavior in my opinion, it's only the reference that is confusing me. I can understand the original pixel alpha not being utilized when completely replaced, but the reference makes it seem the new alpha will not be used either.
On second thought, alpha is used as a percentage of the new color that should overwrite the old one (as the original's alpha is always 100% for the purposes of blending), so maybe a clearer way to put it would be:
REPLACE - the new pixels entirely replace the old ones, including the new alpha (transparency)
Issue description
The reference on blendMode() says:
This is confusing to me, it feels like I cannot set alpha to 0 with it because the new alpha values would not be utilized according to the reference (?), but in fact I can set alpha to 0 with it. This is the desired REPLACE behavior in my opinion, it's only the reference that is confusing me. I can understand the original pixel alpha not being utilized when completely replaced, but the reference makes it seem the new alpha will not be used either.
This behavior is demonstrated here with fill(0,0) and stroke(0,0) on a foreground canvas to reveal an underlying image:
https://gist.github.com/KrabCode/0335de613bbef231e7ec95ac6b60bf8f
URL(s) of affected page(s)
https://processing.org/reference/blendMode_.html
Proposed fix
The text was updated successfully, but these errors were encountered: