Skip to content

rawdenoise: fill X-Trans plane gaps in the top and bottom rows - #22601

Open
kofa73 wants to merge 1 commit into
darktable-org:masterfrom
kofa73:fix-22494
Open

kofa73 wants to merge 1 commit into
darktable-org:masterfrom
kofa73:fix-22494

Conversation

@kofa73

@kofa73 kofa73 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On X-Trans raws, raw denoise left some positions in the top and bottom rows of each color plane without a value of that plane's color. They kept a 0.5 placeholder or a sensel of another color, and the wavelet denoise spread that value up to 31 rows into the output. Exports from the seven models with a 4936x3296 raw area got a green line along the top edge. 14 other models got small color patches at the top corners.

The fix marks these positions and fills each one from the plane value one row inward. That value always comes from a sensel of the plane's color. This is the fix proposed in the issue, plus a pass-through for regions smaller than 6x6, which the pipeline does not produce.

Exports of existing edits on affected models change in the top 40 rows. The parameters do not change, so no migration is needed.

Referenced issue

Fixes #22494
Related: #22488 is a different defect at the ends of row 1, fixed separately by #22600.

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

The issue has the steps to reproduce. Linux x86_64, Release build, CPU only.

  • The new unit test test_rawdenoise passes. Both of its tests fail on the previous code.
  • A replay of this commit's plane building ran under ASan and UBSan, for all 36 CFA alignments and widths and heights 6-40. No position in row 0 or the last row is left unset or holds a value of another color.
  • Exports with the same change, one sample per X-Trans model: the X-E2 top edge changes by up to 16/255 (CIEDE2000 17.7). The 16 models without the defect give identical exports.
  • Integration test 0068-rawdenoise-xtrans, the only one with raw denoise on an X-Trans image, passes on CPU. Its max dE against the reference stays at 1.69726. The fix changes 10 pixels in its top 6 rows, by at most CIEDE2000 1.43.

AI assistance

Claude Code (Claude Opus) found the defect; Codex CLI (Sol) wrote the fix and the unit test; Claude Code (Opus) reviewed.

When wavelet_denoise_xtrans() builds a color plane, some positions in
row 0 and the last row get no value of the plane's color. They kept a
0.5 placeholder or a sensel of another color, and the wavelet denoise
spread that value into nearby output sensels. Models with a 4936x3296
raw area got a green line along the top edge. Other models got small
color shifts at the top corners.

Mark these positions, and fill them from the adjacent row before
denoising. The fill needs complete rows next to the edge, so regions
smaller than 6x6 sensels now pass through unchanged.

Fixes darktable-org#22494
@ralfbrown ralfbrown added bugfix pull request fixing a bug scope: image processing correcting pixels labels Oct 13, 2026
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 scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

raw denoise: green tint along the top edge of X-Trans images from 16 MP Fujifilm models

2 participants