Hello. I want to operate the code like an example image.
I want to make a ghost image come out if I wipe it with an eraser on top of an ordinary girl image.
But my code doesn’t work that way.
How should I change it?
Is it your own code or something you found online?
Try to understand this piece of code:
// Loading the pixels of the window
loadPixels();
// Masking the image with the canvas
img.mask(pixels);
// Displaying the image
image(img, 0, 0);
// Drawing a white ellipse on black background
ellipse(x, y, 90, 90);
You want to instead display the original girl and on top the “ghost” image which will be masked when moving the mouse over it.
To try an easier problem, use two images with one modified (color shifted for example) and try to make an erase effect when you move the mouse.