Search code examples
jpegpaintundo

Undo changes in Paint/image editor


Assuming that paint lets its users undo changes, I wonder whether it's possible to redo those changes by any computer means after the initial file has been saved.

Steps to reproduce:
1. Open a .jpg file in paint
2. Draw a line
3. Save as New.jpg
4. Open New.jpg in paint
5. Delete that line

Is the 5th step actually doable using any software/by coding whatever?


Solution

  • This is a question for SuperUser more than StackOverflow.

    However, the answer is that it's only possible if the software stores the history of change steps to the saved file. Most common interchangeable image formats, like the JPG example in your question, do not support storage of that information.

    An image editor could save to a format, likely to be specific to the editor, which preserves the history of alterations to the image. However, this could lead to a lot of storage of data that is usually not useful in the future, so there isn't a huge amount of demand for the feature.

    Note that what is sought in the question could be done by a new operation to erase the line or parts of it, but not as an undo operation from the prior editing session.