title: Paint Program in Python - Undo and Redo
body: <p>I am currently working on creating a paint program using python and pygame.  I am currently having trouble with creating the undo/redo function in the program.  The way I was thinking of doing so would be to save the canvas image after each time the user releases the mouse, but I am not sure if the individual images would have to be saved in a temporary folder that is deleted after the program is closed.  I have also read that this method can affect performance of the program so I am wondering if there are any other methods that will work more efficiently.  Thank you. </p>