fix #22455 raw denoise: X-Trans green sensels in the last column get a red neighbor's value - #22492
Merged
Merged
Conversation
1 task done
kofa73
marked this pull request as draft
October 3, 2026 10:33
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
Member
|
Manually merged with conflict resolution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
src/tests/integration/where the pixelpipe is touched, ordarktable-clias a headless smoke test._(), new preferences are registered indata/darktableconfig.xml.in.RELEASE_NOTES.mdentry 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.
compareprints 1228 on master and 0 with this change.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