Skip to content

Fix raw denoise on LINEAR-class images (sRaw, ProRAW) - #21429

Merged
TurboGit merged 2 commits into
darktable-org:masterfrom
andriiryzhkov:fix_apple_raw_denoise
Jun 28, 2026
Merged

TurboGit merged 2 commits into
darktable-org:masterfrom
andriiryzhkov:fix_apple_raw_denoise

Conversation

@andriiryzhkov

Copy link
Copy Markdown
Collaborator

Raw denoise didn't work on Apple ProRAW and other pre-demosaiced LINEAR DNGs (reported on pixls.us: neural restore does not work with certain raw images). Preview rejected them outright; the patching path had a latent crash from an under-counted pixel_sz.

What it does

  • Preview accepts the LINEAR class and routes through the linear pipeline
  • pixel_sz multiplies by channel count - fixes the heap corruption that hit any multi-channel mipmap
  • LINEAR write path: float mipmaps get cam values directly (already in [0, 1]); uint16 uses scalar un-prepare math
  • Classifier drives the LINEAR/X-Trans split inside the patching function so 4BAYER (CYGM, RGBE) doesn't fall into FCxtrans with an unset xtrans pattern
  • Warning toast on LINEAR images, deduped (once per imgid in preview, once per job in batch):

    raw denoise: this image is already pre-demosaiced (sRaw / computational raw); results may be limited

@andriiryzhkov andriiryzhkov added this to the 5.6.1 milestone Jun 27, 2026
@andriiryzhkov andriiryzhkov added bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: AI features AI features related issues and PR labels Jun 27, 2026

@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 5a9d6cb into darktable-org:master Jun 28, 2026
5 checks passed
@andriiryzhkov
andriiryzhkov deleted the fix_apple_raw_denoise branch June 29, 2026 07:08
Comment thread src/common/ai/restore_raw_linear.c
piratenpanda pushed a commit to piratenpanda/darktable that referenced this pull request Aug 23, 2026
…aw_denoise

Fix raw denoise on LINEAR-class images (sRaw, ProRAW)
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 scope: AI features AI features related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants