Using the copy() method, you can simulate coloring an image in by copying an image of the colored image on top of the black-and-white image wherever the cursor is dragged.
Copy Image Data by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.