Skip to content

Capture sharpen improvements - #22334

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
jenshannoschwalm:better_auto_capture
Sep 20, 2026
Merged

TurboGit merged 1 commit into
darktable-org:masterfrom
jenshannoschwalm:better_auto_capture

Conversation

@jenshannoschwalm

Copy link
Copy Markdown
Collaborator

Summary: Various fixes for capture sharpening, algorithms stayed identical, current edits are unmodified.

  • As we always calculate the capture sharpen radius in full pipe we have complete image data (after introdution of demosaicscale) and thus can leave out some checks & reports.

  • We now correctly snap the area used for capture radius calculation matching the sensor type, not ensuring this made lead to silently incorrect data.

  • The default capture contrast sensitivity has been further tuned for 14bit raw images.

  • Substantial work on pixelpipe and the module's gui_data interference for safety and in a few cases also for UI performance.

  • I have read CONTRIBUTING.md and the coding style.

  • I don't have 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.

  • 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Auto-tuning regresses headless processing and cropped HQ inputs, while calculation failures can overwrite valid parameters.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 4 Medium severity · 3 Low severity

Open (7)
What changed in this PR

Improves capture-sharpen auto-tuning, sensor-area selection, failure reporting, and GUI synchronization.

Changes:

  • Tunes defaults and 14-bit RAW sensitivity.
  • Refactors CPU/OpenCL radius calculation and GUI updates.
  • Adds release notes.
File Description
src/​iop/​demosaicing/​capture.c Updates radius calculation and error handling.
src/​iop/​demosaic.c Refactors auto-tuning and GUI synchronization.
RELEASE_NOTES.md Documents user-visible fixes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/iop/demosaic.c Outdated
Comment thread src/iop/demosaic.c Outdated
Comment thread src/iop/demosaic.c Outdated
Comment thread src/iop/demosaicing/capture.c Outdated
Comment thread src/iop/demosaic.c Outdated
Comment thread src/iop/demosaicing/capture.c Outdated
Comment thread src/iop/demosaicing/capture.c Outdated
@TurboGit TurboGit added this to the 5.8 milestone Sep 19, 2026
@TurboGit TurboGit added feature: enhancement current features to improve scope: image processing correcting pixels labels Sep 19, 2026
@jenshannoschwalm
jenshannoschwalm requested a balanced review from Copilot September 19, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The asynchronous autotuning handoff can commit stale values, and an OpenCL fallback message incorrectly implies final failure.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (7)

Comment thread src/iop/demosaic.c Outdated
Comment thread src/iop/demosaicing/capture.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Headless processing can access absent GUI state, while concurrent pipes can publish or persist incorrect autotuning results.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (2)

Comment thread src/iop/demosaic.c
Comment thread src/iop/demosaicing/capture.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Autotune synchronization remains race-prone, and OpenCL failures can publish an invalid radius or misleading error.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (2)

Comment thread src/iop/demosaic.c
Comment thread src/iop/demosaicing/capture.c Outdated
@jenshannoschwalm
jenshannoschwalm requested a balanced review from Copilot September 19, 2026 16:39
@jenshannoschwalm jenshannoschwalm added the Abstract provided Includes a 5-liner human written abstract label Sep 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Headless autotuning regressions and request/result synchronization races remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
Resolved since last review (2)

Comment thread src/iop/demosaic.c
Comment thread src/iop/demosaic.c
Comment thread src/iop/demosaicing/capture.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A stale autotune request can carry across image switches and modify the next image.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (3)

Comment thread src/iop/demosaicing/capture.c Outdated
- As we always calculate the capture sharpen radius in full pipe we have complete image
  data (after introdution of demosaicscale) and thus can leave out some checks & reports.

- We now correctly snap the area used for capture radius calculation matching the sensor type,
  not ensuring this made lead to silently incorrect data.

- The default capture contrast sensitivity has been further tuned for 14bit raw images.

- Substantial work on pixelpipe and the module's gui_data interference for safety
  and in a few cases also for UI performance.

- Fixed exports after darkroom editing falling back to auto-calculation of capture radius with
  a defined radius of zero
@jenshannoschwalm

Copy link
Copy Markdown
Collaborator Author

@TurboGit - now ready to go.

@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 31b2dac into darktable-org:master Sep 20, 2026
6 checks passed
@jenshannoschwalm
jenshannoschwalm deleted the better_auto_capture branch September 20, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Abstract provided Includes a 5-liner human written abstract bugfix pull request fixing a bug feature: enhancement current features to improve scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants