Dodge & burn as print exposure; density-driven chemical toning#403
Merged
Conversation
Masks now offset per-pixel print exposure before the H&D curve (same domain as WB filtration) instead of multiplying the finished positive: burns roll into paper black through the toe, dodges lift through the shoulder — no clipped flat patches. Local stage removed; the EV map feeds the exposure pass on CPU and GPU (bit-exact parity), tiled export slices it per tile. Dodge & Burn UI moves to the Exposure tab. Existing dodge/burn edits render slightly differently.
Chemical toners act on the print's silver density instead of luma-masked RGB tints: selenium converts the densest silver first (Dmax boost, cool eggplant shadows), sepia bleach-redevelops the thinnest first (warm highlights, shadows hold, split-sepia at partial strength). Paper white stays white. Runs on the linear buffer — no OETF bracket; CPU and WGSL share TONING_CONSTANTS. GPU chemical toning now gated to B&W like the CPU. Existing toned edits render differently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two physical-realism upgrades to the darkroom print model:
Dodge & burn in the print-exposure domain
2^strength, which clipped to flat black/white); they now offset per-pixel print exposure ahead of the H&D curve, in the same domain as WB filtration. Burns roll into paper black through the toe, dodges lift toward paper white through the shoulder — like holding back light under the enlarger.compute_local_ev_map) feeds the exposure pass on CPU and GPU, tiled export slices it per tile, and the exposure cache stage is keyed on(exposure, local).Density-driven selenium & sepia (B&W)
D = −log10(t)) instead of luma-masked RGB tints: selenium converts the densest silver first (Dmax boost — visibly deeper blacks — and cool eggplant shadows); sepia bleach-redevelops the thinnest silver first (warm highlights, shadows hold; partial strength = classic split-sepia). Paper white stays white.TONING_CONSTANTS. Conversion caps at all-silver-toned so the 0–2 sliders behave as a longer bath.Look change: existing edits using dodge/burn masks or selenium/sepia will render differently (noted in CHANGELOG under 0.34.0).
Test plan
make allgreen (lint, ty, full pytest)..claude/skills/verify/SKILL.mdhas the recipe) — selenium deepens/cools shadows, sepia warms highlights only, −3 EV burn keeps tonal separation, Dodge & Burn section on the Exposure tab.