Skip to content

filmic rgb: scale the graphs to fit target white above 100% - #22667

Open
nicknezis wants to merge 2 commits into
darktable-org:masterfrom
nicknezis:filmic-hdr-graph
Open

nicknezis wants to merge 2 commits into
darktable-org:masterfrom
nicknezis:filmic-hdr-graph

Conversation

@nicknezis

Copy link
Copy Markdown

Summary

filmic rgb accepts target white luminance up to 1600% for HDR output, but its look only and look + mapping (lin/log) graphs kept a fixed 0-100% y axis. Above 100% the shoulder and the white node were drawn past the top of the graph and clipped, so the graph no longer showed what the module did. Those three views now stretch their y axis to the curve's white point, keep the grid on the 0-100% part, and mark 100% display with a line and a "100" label. At 100% or below the graphs look exactly as before. The dynamic range mapping view already handled the value and is unchanged.

filmic-graph-before-after

Referenced issue

Related: #16403

The issue also discusses HDR display and 10-bit output, which this does not address; it fixes the graph scaling the issue reports.

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 any image and enable filmic rgb.
  2. In the display tab, type 400 into target white luminance (the slider's soft limit is 100%; right-click to type).
  3. Cycle the graph through look only, look + mapping (lin) and look + mapping (log). The whole curve and the white node should stay inside the graph, with the y axis topped at 400 and a 100 marker.
  4. Set target white back to 100%. The graphs should be identical to before.

Done so far:

  • builds with no new warnings
  • the GUI was checked under Xvfb on Linux at 100%, 120% and 400% target white in all three views, before and after (filmic-graph-before-after.png)

Not verified: macOS and Windows, HiDPI scaling. No pixel output changes: only dt_iop_tonecurve_draw() in src/iop/filmicrgb.c is touched, so integration tests were not run.

AI assistance: written with Claude Code.

With target white luminance above 100% for HDR output, the look only
and look + mapping (lin/log) graphs kept their y axis at 0-100%, so
the shoulder and the white node were drawn past the top of the graph
and clipped. Only the dynamic range mapping view reflected the value.

Stretch the y axis of those three views to the curve's white point
when it is above 1, keep the grid on the 0-100% part, and draw a line
and a "100" label at 100% display so the headroom stays readable. At
100% or below the graphs are unchanged.

Related: darktable-org#16403

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATMdEKR7uukHKWPW8rTX14
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATMdEKR7uukHKWPW8rTX14
@nicknezis

Copy link
Copy Markdown
Author

Two things look off at 400% that are not from this change:

  • The orange dip in the toe is filmic’s own curve going below the black target at that setting.
  • In the lin view the 0 and 18 labels crowd together, because a linear 0–400% axis squeezes them close.

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