Preserving undo history

Undo history is not just a way to undo actions, it’s a powerful history of your process and project. Isn’t this something that is worth preserving beyond “this session?”

Load anew tomorrow and it’s gone forever. Seems a waste of an “infinite undo” system, too.

Just me?

It’s also a lot of extra data that needs to be saved somewhere. However, sometimes it would be helpful to be able to undo a mistake you made the previous session or after recovering from a crash.

2 Likes

That would make .kra files way bigger with users having no idea why that happened.

Also that’s quite against expectations, as all the programs for editing stuff I know, lose the undo history on quit.

I guess you can use snapshots docker to save document at different states?

ah ok. I didn’t know it takes a lot of data to make it happen. Guess that’s why it’s never preserved in other packages too.

Sorry for being a little bit of off-topic:
That’s why I’ve been preaching for a long time to regularly use the key combination CTRL + ALT + S (‘‘File’’ >> ‘‘Save Incremental Version’’) or F4 (‘‘File’’ >> ‘‘Save Incremental Backup’’) during sessions, depending on which variant you prefer, so I build up an image stack with different editing states along the timeline and can quickly return to such a state if necessary. And at the end of a project, I can then dispose of this stack of images to reclaim the space.
This is my kind of “preserved undo history”!
:wink:

Michelist

2 Likes

Not all, some apps have options to save history to the file. That way, you can shut down your PC and when you get back to work the next day, resume with the undo history in-tact. This could be an option in a save dialog (for a file default) and or the preferences (for application defaults).

It takes as much data as you set in the Performance section of the preferences. Basically, this is usually stored in RAM or written to a temporary file on disc. What I could see happening is that the Krita file is left untouched, but that you save a secondary history file. You can then easily decide whether or not to keep this as back-up and won’t need to fiddle with your existing files to downsave it to save disc space.

2 Likes

The operations in krita are made to the images permanently they are not saved in terms of textual instructions that could be run on the image. For example when a brush stroke is made krita creates pixel data it doesn’t record the corodinates, pen pressure brush type etc in textual form so that the actial can be repeated like a recorder. So this type of saving means saving all the history as one huge kra file, this history file can blow up to large file for bigger images. Some people here create canvases like 16k x 16k in that scenario imagine the file size.

3 Likes

I think with a way to clear undo history (to reclaim the space) it could work and I agree with Hologram there, it is very useful feature one I wish was there for me so many times.

Maybe it should be. I mean, it would be a very useful optimization to consume less memory, not to mention it would pave the way for non-linear undo (basically allowing you to only undo a line you did like 3 actions before, not touching any lines you made since). But this is a discussion for another thread, I think.

My favourite way of working was this:

  1. Save Incremental Version every 30min-1h, or before every major decision or cleaning up the layer stack (removing or merging a lot of data). That keeps the history of my file so I can always go back. I don’t need more often than 30 min.

  2. Autosave set to 3 min. That way I never lose nearly any data, and never lose any important data, when a crash happens.

That’s very hard to do especially since many actions depend on each other. If you remove a smudge brush stroke in the middle of the history, every action after that in the history would have to be reapplied because color mixing and other stuff could have different results now (imagine anything that involves randomness). It’s also not like krita creates a log of user inputs that can be replayed or anything.

1 Like

Actually, I think this is a good request, but I would implement it a different way. Instead of saving the undo history to the image, I would love to see a Session History option, where the current state of Krita (all windows/tabs, dockers, etc) can be automatically saved, and have part of that option be an additional option to save the full memory state, including Undo History, Brush History, Color History, etc. This could be saved to the Krita settings folder, or maybe give an option to save it somewhere else.

If, then it should be put into the Krita-File that is saved, and it should be no problem to put this inside because they are ZIP-Archives. This way, one could even give the files to other users. Only thing would be the plugins, they should be noted in plain-text in the archive, so one can take a look inside the file, install needed plugins and is ready to go.

Michelist

Logging can be added and repeating all the stuff after the undo shouldn’t be a huge problem either, from both the performance and the usability standpoint, especially on the modern hardware. As for random stuff, this could be solved by preserving somehow the random seed using and the count of how many random numbers have been generated so far, resulting in the exact same stroke because there’s no such thing as true randomness in computing.

Keeping a record of all actions done to a raster image in a way that they can be played back and forth from arbitrary points is not easy and not simply a matter of logging.

Sorry for being completely off-topic:

@Takiro, you can crush all my dreams. I was already standing here drooling and with soft knees over this w… dream, thinking @darkhog would submit his associated MR shortly. Now to hear that this is not how it works is devastating.
End of sarcasm mode!

Yes, on paper and at the pub regulars’ table, all problems of our mankind are already solved completely. Only the stupid politicians, scientists, programmers and who else should be able to implement and solve these things, they are simply much too lazy and sluggish.
:see_no_evil: :hear_no_evil: :speak_no_evil:

Michelist

It’s not impossible generally but I think can’t be done in Krita right now, if I remember correctly how it’s currently implemented (I’m checking the source right now). Would mean a total rewrite of the way undo is implemented and it’s not as easy as calculating things backwards. Also not really intuitive in some scenarios like when you would undo a layer transform or move in the middle of the history (because you decided you background was to large after all), should all later brush strokes be offset or not? Could mess up your foreground and everything and you need to be able to do a redo at any point too because of this.

However arbitrary undos in the middle of the history is already off topic from the actual question of making the history preservable.

3 Likes