How To Program An Eraser-Tool-Like Widget?

Hey forum!
Newbie dev here, can anyone give me any pointers on how I can program this type of mechanic?

I want to program a mechanic where the player uses their cursor to wipe across an image of a pot, and a clean version of that pot is underneath. When the pot is completely cleaned the widget should realise that and play a cute little animation to let the player know “hey! You cleaned it all!”

I want to do this as one 2D image (dirty pot) layered on top of another image (clean pot), but I have no idea where to begin figuring out how to program the erasing that tracks with the cursor, then the system that registers when the pot is 100% cleaned.

Sorry if the explanation doesn’t make sense, if you need me to reword myself or explain a little more please let me know, and if you know any tutorials that might help me then share a link!