Hello @GoodJuJu,
A related topic:
I modified code above to have 2 PGraphics and did this:
pg2.mask(pg1);
The resources here will have more details:
https://processing.org/
References:
- https://processing.org/reference/PImage.html
- https://processing.org/reference/PImage_mask_.html
- https://processing.org/reference/texture_.html
- See tutorials on PShapes and Images and Pixels
:)