Skip to content

Scopes hdr scale - #22662

Open
nicknezis wants to merge 2 commits into
darktable-org:masterfrom
nicknezis:scopes-hdr-scale
Open

nicknezis wants to merge 2 commits into
darktable-org:masterfrom
nicknezis:scopes-hdr-scale

Conversation

@nicknezis

Copy link
Copy Markdown

scopes: PQ and HLG scales for histogram, waveform and parade

Branch: nicknezis:scopes-hdr-scale

Summary

The histogram, waveform and RGB parade only show an SDR scale, so you can't see where highlights will land in a PQ or HLG export. A new button in the scopes cycles between SDR, PQ and HLG. In HDR modes the scope converts the preview to linear Rec.2020 and plots the PQ or HLG signal that an export would carry. The PQ scale is marked at 1, 10, 100, 203, 1000 and 4000 nits, and the HLG scale at 25, 50 and 75% signal. Reference white (203 nits, or 75% HLG) is drawn dashed. The button is hidden for the vectorscope, and the choice is stored in plugins/darkroom/histogram/hdr_scale.

Referenced issue

Related: #17710

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. In darkroom, show the waveform, and use an image whose highlights go above 100% (for example AgX with target white above 100%).
  2. Click the new HDR scale button. The first click shows PQ with nit grid lines, the second HLG, and the third returns to SDR. The tooltip describes the current scale.
  3. Repeat in histogram and RGB parade modes. Switch to the vectorscope and check that the button is hidden.

Done so far: every commit builds, and all modes were checked in the GUI under Xvfb on Linux.

Not verified: macOS and Windows. The scopes read the preview's display-profile output (_scope_process in src/libs/histogram.c), so with an ICC display profile that clips above 1.0, the HDR scales would show that clip and not the export signal.

AI assistance

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

scope-waveform-pq scope-waveform-hlg scope-histogram-pq scope-parade-pq

The scopes only had an SDR scale: the waveform tops out a little above
1.0 and the histogram bins 0 to 1, so the headroom of an HDR edit was
squashed against the top and could not be judged.

Add a button that cycles the histogram, waveform and RGB parade
between the SDR scale, a PQ scale and an HLG scale. On an HDR scale
the preview is converted to linear Rec2020 and encoded as the BT.2100
signal an HDR export would carry, using the shared transfer functions
in common/hdr-transfer.h. PQ is gridded in nits from 1 to 4000 with
203 nit reference white marked; HLG in percent of signal with
reference white marked at 75%. The vectorscope and split view keep
the SDR path. The choice is kept in conf.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Hf5bYk6AYsiHXNmKFEr15
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Hf5bYk6AYsiHXNmKFEr15
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.

2 participants