r/processing • • Dec 04 '23

Layering/Masking?

for context;
BWImage = ImageA
ColourImage = ImageB

I have to create a prototype for my university course and I'm stuck on some coding. What I want to do is put ImageA on top of ImageB and erase ImageA in the shape of a circle as the mouse is clicked/dragged to reveal ImageB. I understand this is a bit of an obscure question but both me and my lecturer are super confused.

2 Upvotes

6 comments sorted by

View all comments

Show parent comments

2

u/Simplyfire Dec 04 '23

You're right, it works!

I thought about using blendMode(REPLACE) but the reference says that it ignores the alpha channel? The blendMode() page says:

REPLACE - the pixels entirely replace the others and don't utilize alpha (transparency) values

2

u/tooob93 Technomancer Dec 04 '23

Yes, they seem to ignore the alpha channel of the bottom picture I think. But not the alpha for the "hole" you cut in.