Non-destructive JPEG editing?

Hi, just wondering since Darktable states that it is “a non-destructive image editor and opens all images in read-only mode. Any data created within darktable (metadata, tags, and image processing steps) is stored in separate .XMP sidecar files”.
Does this apply to editing JPEGs as well? Can’t find any clear answer to this.
Thanks.

Yes, as long as you don’t accidentally overwrite the original JPEG in export (which may be more likely than for any non-JPEG file)

1 Like

Thanks, but this is still a bit unclear. To test this I removed the .xmp file associated witht a test jpeg picture I had done some editing on. I expected the edits to be gone and the JPEG to appear in its original unedited version (since the .xmp was removed). But all the edits were still there. Any idea on how this works for JPEG?

The primary storage for editing information is darktable’s database, a sqlite database in your home folder (see the manual for the exact location on your OS). xmp files are more or less only written as backup and to interact with other software. Source files are, independent of the format, never touched, besides the exception mentioned by @Entropy512 – at least by darktables core functionality. There may be lua extensions that break this rule (not sure if this is actually the case), but these are for sure not activated or even installed by default.

1 Like

DT will do a non-destructive edit of the JPG in every sense of the word. But as with any JPG edit in any program when exporting the finished product you must ensure you do not overwrite the original. In the export module the default behaviour is to upon conflict to create a new name which means it will not overwrite, but if you deliberately change to upon conflict option to overwrite then of course it will.

The original JPG will appeared altered when viewed in DT unless you reset the history to remove all your edits. I just tested and confirmed all of these actions on a JPG in DT before posting.

Welcome to the forum. Which program had you been using previous to DT?

2 Likes

darktable caching maybe?

Check the file outside of darktable - do an md5sum or shasum before and after. The file should not change.

To summarise:

  • darktable will not overwrite an original file (raw, jpg or other formats), unless you explicitly ask to overwrite the file while exporting and it’s a format dt can write.
  • The database is used to decide what to display/which edits to apply. Darktable will only reread sidecar files to update the database when asked to do so.

Database updates from sidecar files can be done either on startup, if that option is selected in the settings (default is off: no checking for updated sidecar file), or, for selected images, when the user requests it during a run.

Removing a sidecar file won’t remove the edits, afaik (as they will still be in the database).

4 Likes

Thanks all for the information, this sounds good. I’m a beginner with Darktable, having made the transition from Lightroom.

Plus from a single file you can have several edits in DT :

  • in light table mode, select your image edit
  • go to selected menu and click duplicate
  • then go to history stack and click delete history stack

This will create a new entry for your jpg with no edit associated and you’ll preserve the other entry with associated edits.

From the same history stack menu, you can apply external xmp (edits) files to an image entry of the light table as well.

As long as you do not export an edit, DT reprocess a view from the base file and the edit to show your work, if you want to watch your edited version in an external viewer, you have to export that will create a new file with your modification applied.

2 Likes

Or click ‘original’ in the darkroom.
image

Or use duplicate on the lighttable, then open the duplicate in the darkroom, select 0 - original in the history and click compress history stack:
image

3 Likes