A way you could save the current frame is creating a PImage object with the same size as your sketch, then at the end of draw, copy the canvas to the PImage using PImage copy(). Then, whenever the mouse is clicked, save the PImage and not your sketch canvas.