Skip to content

Neural restore RAW denoise exports appear brighter than the source #22767

Open

Description

@AyedaOk

Is there an existing issue for this?

  • I checked and did not find my issue in the already reported ones

Describe the bug

Darktable’s exports through Raw Denoise appear brighter than the original files. The increase varies by scene.

Steps to reproduce

  1. Use a RAW source files.
  2. Denoise it with RawNIND through Darktable’s RAW-denoise.
  3. Render the original RAW.
  4. Compare matching crops and calculate mean linear luminance before display gamma

Expected behavior

RAW denoising should preserve overall brightness.

Logfile | Screenshot | Screencast

Image

Commit

N/A

Where did you obtain darktable from?

distro packaging

darktable version

5.6.2

What OS are you using?

Linux

What is the version of your OS?

Arch

Describe your system

N/A

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

RTX 5060 ti

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

I've realized this when trying to benchmark denoise models. Results from raw denoise didn't make sense and the agent said it was because of brightness:

Possible gain-matching error
In src/common/ai/restore_raw_bayer.c, _bayer_gain_match() calculates:
gain = mean(packed Bayer input) / mean(RGB output)
The input mean counts green twice; the output mean gives each RGB channel equal weight. For constant channel values where G1 = G2:
Bayer mean = (R + 2G + B) / 4
RGB mean   = (R + G + B) / 3
These means differ even with perfect color reconstruction. A green-heavy tile can receive an unwanted brightness boost. A neutral tile hides the mismatch.

I could then visualy confirm it with my eyes.

Activity

  1. jenshannoschwalm commented on Oct 24, 2026

    @jenshannoschwalm
    Collaborator

    So this is not raw denoise!

  2. AyedaOk commented on Oct 24, 2026

    @AyedaOk
    ContributorAuthor

    You're right! I mean the Neural restore raw denoise, not the “raw denoise” processing module. I've edited the title accordingly.

    I also saw this other denoise models, so I know the brightness don't come from the RawNIND.

  3. changed the title [-]RAW denoise exports appear brighter than the source[/-] [+]Neural restore RAW denoise exports appear brighter than the source[/+] on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions