Skip to content

Skip auto-applied denoise presets on AI denoised output - #21940

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_21391
Aug 23, 2026
Merged

Skip auto-applied denoise presets on AI denoised output#21940
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_21391

Conversation

@andriiryzhkov

Copy link
Copy Markdown
Collaborator

Fixes #21391

If you have denoise (profiled) as an auto-apply preset, it fires again on the DNG that AI raw denoise produces. The output keeps the source ISO, so an ISO-ranged preset matches it exactly as it matched the original raw – darktable has no way of knowing the work has already been done.

So the DNG now says so itself. The writer stamps Xmp.darktable.neural_restore = "raw-denoise" into the file, dt_exif_read picks it up at import and sets a new DT_IMAGE_AI_DENOISED flag, and _dev_auto_apply_presets leaves denoiseprofile and rawdenoise out of its query for those images – the same trick already used for basecurve in a display-referred workflow. Keeping the marker in the file rather than the database means it survives a manual import, a film roll rescan or a rebuilt library.

Only automatic application is suppressed; you can still enable the module yourself, which is what the thread asked for. A preference switches the stamping off for anyone who doesn't want darktable writing that into their files, and says plainly that this also removes the protection.

Astrophoto denoise deliberately stays out of the skip list – auto-applying it is usually a choice. IPTC DigitalSourceType would be the standards-correct way to announce this to other software, but it's single-valued and sharpening elsewhere sets the same code, so it can't drive the decision and belongs in its own change.

@andriiryzhkov andriiryzhkov added the scope: AI features AI features related issues and PR label Aug 21, 2026
@wpferguson

Copy link
Copy Markdown
Member

Maybe we should think about another way to solve this. Not writing to image files is one of the founding principles of darktable.

Maybe we need to make module auto apply a little smarter.

@andriiryzhkov

Copy link
Copy Markdown
Collaborator Author

We can think of other way, but lets first align on what actually gets written where:

  • The original raw is never modified. We only read it.
  • The new DNG is created by darktable. libtiff writes the image data and DNG tags, and then the existing code reopens that file to merge the source EXIF into it. That already happens on master, before this PR.
  • This PR adds one XMP property to that same new DNG: Xmp.darktable.neural_restore = "raw-denoise".

@andriiryzhkov

Copy link
Copy Markdown
Collaborator Author

@wpferguson : does this mean you think this approach is reasonable?

@wpferguson

Copy link
Copy Markdown
Member

So we're just adding a little bit more to what we are already writing. Consider my comment withdrawn 😄

Though auto apply could be a little smarter (not just for this).

@TurboGit TurboGit added this to the 5.8 milestone Aug 22, 2026
Comment thread data/darktableconfig.xml.in Outdated

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit
TurboGit merged commit a9e3aa4 into darktable-org:master Aug 23, 2026
6 checks passed
@TurboGit TurboGit added bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending labels Aug 23, 2026
@andriiryzhkov
andriiryzhkov deleted the fix_21391 branch August 23, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending scope: AI features AI features related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'denoise (profiled)' does not consider AI denoising

3 participants