Render raws through the DNG reference curve by default, at contrast 1.5

Decides D21 by measurement. The photo gallery holds Lightroom 6 exports of
raws in the library, each carrying its Camera Raw settings; clustered by
those settings, 663 had no look applied. On 60 of them with their raws,
a third held out, the held-out MSE against Lightroom's JPEG was about 1200
for 0.20.0's sigmoid (0.7 EV darker and flatter), 224 for the DNG reference curve
after baseline exposure, and about 140 once its input is bent by 1.5/1.4
about grey.

So the curve choice defaults to the DNG reference, keeping its index (sidecars
record it), and the default contrast is 1.5. Contrast under the DNG reference curve is
now a power relative to REFERENCE_CONTRAST (1.4), where the table is
untouched; the sigmoid at that contrast still matches the retired base
curve. JPEGs are unaffected: the view transform skips a rendered source.
This commit is contained in:
2026-10-03 15:54:21 -04:00
parent b69fb3e191
commit a4ff7ec2b9
9 changed files with 108 additions and 32 deletions
+19 -6
View File
@@ -51,8 +51,19 @@ pub const SCENE_GREY: f32 = 0.13;
/// Display-linear middle grey — what a camera JPEG shows a grey card as.
pub const DISPLAY_GREY: f32 = 0.18;
/// The default contrast, the sigmoid's log-log slope parameter `n`.
pub const DEFAULT_CONTRAST: f32 = 1.4;
/// The default contrast: the sigmoid's log-log slope `n`, and for Camera
/// Raw's curve a power of `DEFAULT_CONTRAST / REFERENCE_CONTRAST` about grey.
///
/// Fitted, not chosen: on Lightroom 6 exports whose look settings were neutral,
/// Camera Raw's curve matched the exports best with the input bent by about
/// 1.08 (held-out MSE 224 at 1.4, ~150 at 1.5). The sigmoid, which is no longer
/// the default, fitted best near 1.7 and is better at 1.5 than at 1.4.
pub const DEFAULT_CONTRAST: f32 = 1.5;
/// The contrast at which each curve is its own reference: the sigmoid's match
/// to the retired base curve (see the module note), and Camera Raw's table
/// untouched.
pub const REFERENCE_CONTRAST: f32 = 1.4;
/// The default white point, in stops above [`SCENE_GREY`].
pub const DEFAULT_WHITE: f32 = 4.0;
@@ -223,11 +234,13 @@ mod tests {
}
#[test]
fn the_default_stays_close_to_the_retired_curve() {
fn the_reference_stays_close_to_the_retired_curve() {
// TRACES: FR-DEV-3j | FR-DEV-3e
// D19's promise to every existing photograph: the midtones do not
// move by more than a third of a stop.
let s = Sigmoid::default_curve();
// D19's promise, now kept by the sigmoid at its reference contrast
// rather than by the default (D21 moved the default to Camera Raw's
// curve): the midtones do not move by more than a third of a stop
// from the retired base curve.
let s = Sigmoid::new(REFERENCE_CONTRAST, DEFAULT_WHITE);
let mut x = 0.03_f32;
while x <= 1.0 {
let ev = (s.channel(x) / retired_default(x)).log2();