Skip to content

sigmoid: allow target white above 1600% for HDR output - #22668

Closed
nicknezis wants to merge 3 commits into
darktable-org:masterfrom
nicknezis:sigmoid-hdr-target-white
Closed

nicknezis wants to merge 3 commits into
darktable-org:masterfrom
nicknezis:sigmoid-hdr-target-white

Conversation

@nicknezis

@nicknezis nicknezis commented Oct 17, 2026 •

Copy link
Copy Markdown

Branch: nicknezis:sigmoid-hdr-target-white

Summary

Sigmoid's target white was capped at 1600%. With PQ reference white at 203 nits, that limits a sigmoid edit to about 3250 nits while PQ reaches 10000. The hard maximum is now 5000% (about 10000 nits), so sigmoid can fill the whole PQ range. The slider's soft range stays at 50-100%, so nothing changes for SDR work; HDR values are typed in (right-click) as before. The tooltip now explains that 100% is the 203 nit reference white and that 1000 nits is about 493%.

Referenced issue

This is distinct from #18271, which asked for a wider visible slider range.

Fixes #22665
Related: #20242

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

  1. Open a raw, enable sigmoid, and set the export profile to PQ Rec2020.
  2. Right-click sigmoid's target white and type 4900. It should be accepted (it was clamped to 1600 before).
  3. Export to AVIF or JXL. Highlights should reach close to 10000 nits.

Done so far:

  • every commit builds (git rebase --exec 'cmake --build build' master)
  • darktable-cli on a synthetic -10 to +12 EV ramp, exported as linear Rec2020 PFM: at 100%, 1600% and 5000% the peak is 1.00, 15.96 and 49.57, middle grey stays at 0.179, and the output is monotonic with no NaN or Inf
  • integration tests 0097-sigmoid and 0151-sigmoid-no-hue-preservation pass on CPU

Not verified: the GUI slider itself, OpenCL, real raws, macOS and Windows. The params struct, its version and the defaults are unchanged; only the upper limit moved, so existing edits render the same.

AI assistance

The code, commit messages and this description were written with Claude Code. I reviewed the diff.

With PQ output 100% is the 203 nit reference white, so the 1600% hard
limit capped a sigmoid edit at about 3250 nits while PQ reaches 10000.
Raise the hard maximum to 5000%, about 10150 nits and so the top of the
PQ range, and keep the 50-100% soft range so the slider is unchanged
for SDR work. The tooltip now explains how to use the value for HDR
output.

Fixes darktable-org#22665

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HsykTqvsWoMew3BXJWE2KA
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HsykTqvsWoMew3BXJWE2KA
Comment thread src/iop/sigmoid.c Outdated
@nicknezis

Copy link
Copy Markdown
Author

Closing in favor of #22669, which takes the peak from the output instead of a manual target white, following the design agreed in #22661.

@nicknezis nicknezis closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sigmoid: allow target white above 1600% for HDR output

3 participants