Skip to content

fix #22455 raw denoise: X-Trans green sensels in the last column get a red neighbor's value - #22492

Merged
TurboGit merged 2 commits into
darktable-org:masterfrom
kofa73:fix/22455
Oct 5, 2026
Merged

TurboGit merged 2 commits into
darktable-org:masterfrom
kofa73:fix/22455

Conversation

@kofa73

@kofa73 kofa73 commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On X-Trans images, raw denoise never put a green sensel in the last column into the green plane, because the loop that builds the plane stops one column short of it. If the left neighbor was green, the position kept that neighbor's value. Otherwise it kept the value the red pass left there, or the 0.5f placeholder in the top and bottom rows. The sensel's denoised output was computed from that value, so colors along the right edge were slightly wrong. The edge code now writes the sensel's own value.

X-Trans images with raw denoise now render differently along the right edge. That includes the pattern alignments that #22455 calls unaffected, where the sensel had its green left neighbor's value instead of its own. For the test 0068 edit at full size, 13952 pixels change, all in the rightmost 39 columns, by up to 11/255. No parameters change.

Referenced issue

Related: #22488. The edge code in the same loop still skips row 0 when it fills row 1, so wrong pixels at a top corner remain. This change does not touch that.

Checklist

  • I have read CONTRIBUTING.md and the coding style.
  • I have not merged master into the topic branch.
  • The pull request is one logical change, and every commit compiles on its own.
  • I ran the relevant tests: unit tests, src/tests/integration/ where the pixelpipe is touched, or darktable-cli as a headless smoke test.
  • [N/A] New user-visible strings use _(), new preferences are registered in data/darktableconfig.xml.in.
  • A RELEASE_NOTES.md entry was added (only needed if fixing an issue in a release). Do not reference GitHub issues.

Test instructions

Linux, 12 CPUs, Release build, CPU path. Raw denoise has no OpenCL code.

To check, follow the reproduction steps in #22455. They set the noise threshold to 1e-6, so raw denoise should return its input nearly unchanged. compare prints 1228 on master and 0 with this change.

  • Integration tests 0049 and 0068 pass. For 0068, the max dE against the reference rises from 1.61 on master to 1.70. The limit is 2.3.
  • The full-size export of the 0068 edit changes in 13952 pixels, in columns 6213-6251, by up to 11/255.

X-Trans images other than mire1-xtrans.raf, Windows and macOS were not tested.

AI assistance

Written by Claude Code which found the defect, wrote the change and ran the tests above. Reviewed by Codex CLI, Antigravity CLI.

Fixes #22455

@TurboGit TurboGit added this to the 5.8 milestone Oct 3, 2026
@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 scope: image processing correcting pixels labels Oct 3, 2026
@kofa73
kofa73 marked this pull request as draft October 3, 2026 10:33
kofa73 added 2 commits October 3, 2026 11:29
The green pass of wavelet_denoise_xtrans() never wrote a green sensel in
the last column into the plane, because the main loop stops one column
short. The position kept its green left neighbor's value or, if that
neighbor was not green, a value left over from before the green pass:
the red plane's value, or the 0.5f placeholder in the top and bottom
rows. The sensel's output was computed from that. Write the sensel's own
value instead.

Fixes darktable-org#22455
@kofa73
kofa73 marked this pull request as ready for review October 3, 2026 12:40
@TurboGit
TurboGit merged commit 61dea29 into darktable-org:master Oct 5, 2026
5 checks passed
@TurboGit

TurboGit commented Oct 5, 2026

Copy link
Copy Markdown
Member

Manually merged with conflict resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:generated bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

raw denoise: X-Trans green sensels in the last column get a red neighbor's value

2 participants