Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6d29e03
LR-BEHAV-RENDER-FIDELITY: process V8, Whites and the tone curves meas…
smi-leonivkovic Nov 10, 2026
1835f3a
LR-EDIT-COLOR-MIXER-HSL: process V8, the colour mixer measured agains…
smi-leonivkovic Nov 10, 2026
65bbb4c
LR-EDIT-COLOR-GRADING: process V8, Colour Grading measured against Li…
smi-leonivkovic Nov 10, 2026
b16fd0c
LR-BEHAV-RENDER-FIDELITY: doc comments for the V8 curve stage, Gap 3 …
smi-leonivkovic Nov 11, 2026
3fd3930
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
a8280a6
LR-EDIT-COLOR-MIXER-HSL: test that V8 leaves the mixer to the mixer s…
smi-leonivkovic Nov 11, 2026
2f93829
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 11, 2026
4fd64f8
LR-EDIT-COLOR-GRADING: mixer docs name V8's grading stage, doc commen…
smi-leonivkovic Nov 11, 2026
969ab28
LR-BEHAV-RENDER-FIDELITY: process V8, Lightroom's default base curve …
smi-leonivkovic Nov 11, 2026
6cb4e5b
Merge remote-tracking branch 'origin/main' into lr-v8-tone
smi-leonivkovic Nov 11, 2026
9188e4d
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
815ebe6
LR-BEHAV-RENDER-FIDELITY: what's new names process 9 (#523)
smi-leonivkovic Nov 11, 2026
95b9016
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
c067d02
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 11, 2026
8e4cc71
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
7689bf4
Merge remote-tracking branch 'origin/main' into lr-v8-grading
smi-leonivkovic Nov 11, 2026
7b71468
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
0793d08
LR-BEHAV-RENDER-FIDELITY: exposure offsets measured for the Lumix S5,…
smi-leonivkovic Nov 11, 2026
fc55dde
LR-BEHAV-RENDER-FIDELITY: review fixes: neutral-render claims, Whites…
smi-leonivkovic Nov 11, 2026
92f35bb
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
c7c5ee2
LR-EDIT-COLOR-MIXER-HSL: review fixes: each slider's amount bracket o…
smi-leonivkovic Nov 11, 2026
9815bad
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 11, 2026
7196856
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
5154467
LR-BEHAV-RENDER-FIDELITY: review fixes: measured curve tables only at…
smi-leonivkovic Nov 11, 2026
93c9132
Merge lr-v8-tone into lr-v8-color; review fixes: V1 to V8 also run th…
smi-leonivkovic Nov 11, 2026
e43cb44
Merge lr-v8-color into lr-v8-grading (#523)
smi-leonivkovic Nov 11, 2026
dfede7b
LR-EDIT-COLOR-GRADING: review fix: damping linear between its angle b…
smi-leonivkovic Nov 11, 2026
23d5484
Merge lr-v8-grading into lr-v8-base (#523)
smi-leonivkovic Nov 11, 2026
30c8319
LR-EDIT-COLOR-GRADING: rustfmt (#523)
smi-leonivkovic Nov 11, 2026
b40d6aa
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
7d20abd
LR-BEHAV-RENDER-FIDELITY: review fix: Calibration runs before the ton…
smi-leonivkovic Nov 11, 2026
1d03da3
Merge lr-v8-color into lr-v8-grading (#523)
smi-leonivkovic Nov 11, 2026
c58e425
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
b1f6a66
LR-EDIT-LIGHT-CURVE-PARAM: the parametric graph draws and drags the c…
smi-leonivkovic Nov 11, 2026
0bbd0fc
LR-BEHAV-RENDER-FIDELITY: review fixes: the chart tool refuses render…
smi-leonivkovic Nov 11, 2026
e0193c8
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
b0e9b29
Merge branch 'lr-v8-tone' into lr-v9-curve-graph
smi-leonivkovic Nov 11, 2026
568e53d
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 11, 2026
b94de27
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
6f565fe
LR-EDIT-LIGHT-CURVE-PARAM: review fixes: a graph drag searches the cu…
smi-leonivkovic Nov 11, 2026
a8b4d7e
LR-BEHAV-RENDER-FIDELITY: review fixes: the measured tables are read …
smi-leonivkovic Nov 11, 2026
00405c3
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
2a379ff
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 11, 2026
ff287d9
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 11, 2026
0b26397
Merge branch 'lr-v8-tone' into lr-v9-curve-graph
smi-leonivkovic Nov 11, 2026
8bec5c5
LR-EDIT-LIGHT-CURVE-PARAM: review fixes: doc comments on the graph's …
smi-leonivkovic Nov 11, 2026
3437e59
Merge remote-tracking branch 'origin/main' into lr-v8-tone
smi-leonivkovic Nov 14, 2026
099c0f9
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 14, 2026
c51da98
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 14, 2026
a1f5477
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 14, 2026
5ba1722
Merge branch 'lr-v8-tone' into lr-v9-curve-graph
smi-leonivkovic Nov 14, 2026
14909c4
curve_stage: say in apply's doc that values above white are added bac…
smi-leonivkovic Nov 18, 2026
f54fd34
LR-EDIT-LIGHT-CURVE-PARAM: the parametric graph's fix from #4126 land…
smi-leonivkovic Nov 20, 2026
03de271
Merge origin/main into lr-v8-tone
smi-leonivkovic Nov 20, 2026
789c1a0
LR-BEHAV-RENDER-FIDELITY: Whites and the parametric regions are a fit…
smi-leonivkovic Nov 24, 2026
d1ce3c8
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 24, 2026
c9dfb53
LR-EDIT-COLOR-MIXER-HSL: the colour mixer is a fitted model, not a me…
smi-leonivkovic Nov 24, 2026
3cabaf9
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Nov 24, 2026
13fac86
LR-EDIT-COLOR-GRADING: Colour Grading is a fitted model, not measured…
smi-leonivkovic Nov 24, 2026
18409da
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 24, 2026
fde6f70
LR-BEHAV-RENDER-FIDELITY: the default base curve is 12 fitted knots, …
smi-leonivkovic Nov 24, 2026
18020ec
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 24, 2026
0fd6668
LR-EDIT-COLOR-GRADING: grading-stage.md reports the fitted series on …
smi-leonivkovic Nov 24, 2026
cd6195b
LR-BEHAV-RENDER-FIDELITY: default-tone.md reports the fitted series o…
smi-leonivkovic Nov 24, 2026
cfc8c22
LR-EDIT-COLOR-GRADING: as_chunks for the model's constant groups (cli…
smi-leonivkovic Nov 24, 2026
0f6b536
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Nov 24, 2026
7c0e8ea
Merge main into lr-v8-tone (#523)
smi-leonivkovic Dec 2, 2026
be29de8
Merge remote-tracking branch 'origin/main' into lr-v8-tone
smi-leonivkovic Dec 3, 2026
5ae163c
Merge lr-v8-tone (with main) into lr-v8-color (#523)
smi-leonivkovic Dec 3, 2026
c1d63a2
Merge lr-v8-color (with main) into lr-v8-grading (#523)
smi-leonivkovic Dec 3, 2026
880c540
Merge lr-v8-grading (with main) into lr-v8-base (#523)
smi-leonivkovic Dec 3, 2026
8495512
refactor(default_tone): from V17 as a comparison, as the curve stage …
smi-leonivkovic Dec 3, 2026
1f53475
test(curve): the drag test allows the framework's drag threshold, not…
smi-leonivkovic Dec 3, 2026
4f01fd1
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Dec 3, 2026
19cfa00
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Dec 3, 2026
9f2b85c
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Dec 3, 2026
ff7529a
Merge main into lr-v8-tone: the series moves to process V18 (#523)
smi-leonivkovic Dec 3, 2026
a85845d
test(proraw): V18's curve stage leaves Whites to the ProRAW chain; V1…
smi-leonivkovic Dec 3, 2026
2722f97
fix(curve_stage): Refine Saturation restores the colour after Whites …
smi-leonivkovic Dec 3, 2026
5a58233
fix(curve_input): under V18 sample where the curve stage reads (#523)
smi-leonivkovic Dec 3, 2026
de0c5a8
fix(tools): the tone charts' manifest carries the tool's prefix and f…
smi-leonivkovic Dec 3, 2026
ee3071e
Merge lr-v8-tone into lr-v8-color: the series moves to process V18 (#…
smi-leonivkovic Dec 3, 2026
72cd3a9
Merge lr-v8-color into lr-v8-grading: the series moves to process V18…
smi-leonivkovic Dec 3, 2026
87df28f
Merge lr-v8-grading into lr-v8-base: the series moves to process V18 …
smi-leonivkovic Dec 3, 2026
023c93c
test(gpu): the curve-input prefix test names V17, where the sample is…
smi-leonivkovic Dec 3, 2026
e246094
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Dec 3, 2026
5fcf5c9
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Dec 3, 2026
c08c72d
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Dec 3, 2026
a8872ab
fix(curve_input): on ProRAW the sample's curve stage leaves Whites to…
smi-leonivkovic Dec 3, 2026
fbf3704
Merge lr-v8-tone into lr-v8-color; curve-stage.md names V18's colour …
smi-leonivkovic Dec 3, 2026
ff2898d
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Dec 3, 2026
642aab4
fix(smart): back to encoding 4; previews never stored default_tone, s…
smi-leonivkovic Dec 3, 2026
587ed53
docs: V17's Apple ProRAW uses its chain's fitted Whites, not V2 White…
smi-leonivkovic Dec 3, 2026
6f70731
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Dec 3, 2026
3c308bf
Merge branch 'lr-v8-color' into lr-v8-grading
smi-leonivkovic Dec 3, 2026
9917c4a
Merge branch 'lr-v8-grading' into lr-v8-base
smi-leonivkovic Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions crates/develop/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,17 @@ pub enum Process {
/// V16, with Apple ProRAW's tone sliders running in Lightroom's fitted tone chain
/// (`lightcraft_pipeline::proraw`).
V17,
/// V17, with Whites and the parametric curve from a fitted model, and the tone curves applied
/// hue-preserving: Whites, the parametric and point curve in linear ProPhoto RGB, then the red, green and
/// blue curves per channel, before the colour stage (`lightcraft_pipeline::curve_stage`,
/// `docs/curve-stage.md`).
V18,
}

impl Process {
/// Every process, oldest first (`ProcessVersion(9)` names none and renders as V8; 11 and 12 name none and
/// render as V10).
pub const ALL: [Process; 14] = [
pub const ALL: [Process; 15] = [
Process::V1,
Process::V2,
Process::V3,
Expand All @@ -147,8 +152,9 @@ impl Process {
Process::V15,
Process::V16,
Process::V17,
Process::V18,
];
pub const LATEST: Process = Process::V17;
pub const LATEST: Process = Process::V18;

pub const fn version(self) -> ProcessVersion {
match self {
Expand All @@ -166,6 +172,7 @@ impl Process {
Process::V15 => ProcessVersion(15),
Process::V16 => ProcessVersion(16),
Process::V17 => ProcessVersion(17),
Process::V18 => ProcessVersion(18),
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions crates/engine/src/files/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ fn load_bytes_now(
let proraw =
(dcp.is_none() && camera_look.is_none()).then(|| proraw_tone(&raw, t.baseline_exposure as f32, &img.data)).flatten().map(Arc::new);
let local_tone = local_tone(&raw);
// From process V18 a profile without a tone curve of its own (Adobe Standard) renders with the fitted
// default curve, shifted by the camera's measured exposure offset (`lightcraft_pipeline::default_tone`).
let default_tone = dcp.filter(|p| p.color.profile.tone_curve.is_none()).map(|_| {
let m = &raw.metadata;
lightcraft_pipeline::default_tone::camera_ev(m.make.as_deref().unwrap_or(""), m.model.as_deref().unwrap_or(""))
});
let (temp, tint) = scale.as_shot(xy);
return Ok((
img,
Expand All @@ -271,6 +277,7 @@ fn load_bytes_now(
legacy_relative_wb: scale.legacy_relative,
camera_color,
camera_tone,
default_tone,
mattes,
local_tone,
proraw,
Expand Down
7 changes: 7 additions & 0 deletions crates/engine/src/smart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ struct SmartFacts {
lens: Option<lightcraft_develop::EmbeddedLens>,
camera_color: Option<lightcraft_pipeline::CameraColor>,
local_tone: Option<lightcraft_pipeline::local_tone::LocalTone>,
/// `SourceInfo::default_tone`. Smart previews are built without the photo's camera profile, so this is `None` for
/// them today and an offline photo renders on its stored camera tone (`docs/default-tone.md`); recorded so a
/// preview built with the profile can carry it without a format change.
#[serde(default)]
default_tone: Option<f32>,
/// Apple ProRAW's profile curve for Lightroom's tone chain (absent before version 4: such a
/// proxy renders ProRAW on the camera-curve path, retaining V16 behavior).
#[serde(default, deserialize_with = "lenient_proraw")]
Expand Down Expand Up @@ -239,6 +244,7 @@ pub(crate) fn encode_with_lens_key(img: &Rgb32f, info: Option<&SourceInfo>, lens
lens: i.lens,
camera_color: i.camera_color.as_deref().cloned(),
local_tone: i.local_tone.as_deref().cloned(),
default_tone: i.default_tone,
proraw: i.proraw.as_deref().cloned(),
mattes: matte_list,
};
Expand Down Expand Up @@ -287,6 +293,7 @@ pub fn decode(bytes: &[u8]) -> Result<(Rgb32f, Option<CameraTone>, Option<Source
lens: f.lens,
camera_color: f.camera_color.map(Arc::new),
camera_tone: tone,
default_tone: f.default_tone,
mattes: (!mattes.is_empty()).then(|| Arc::new(mattes)),
local_tone: f.local_tone.map(Arc::new),
proraw: f.proraw.map(Arc::new),
Expand Down
23 changes: 23 additions & 0 deletions crates/engine/src/tests/dcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ fn a_profile_without_a_tone_curve_keeps_the_photos_contrast() {
assert!((tone.apply(0.18) - 0.45).abs() < 0.01, "{}", tone.apply(0.18));
}

/// Process V18 (`lightcraft_pipeline::default_tone`): a profile without a tone curve marks the source for the fitted
/// default curve (a camera with no measured offset: 0 stops); a profile with a curve, or no profile, does not. Up to
/// V7 the base tone stays the file's own.
#[test]
fn a_profile_without_a_tone_curve_gets_the_default_curve_from_v9() {
use lightcraft_develop::{DevelopSettings, Process};
use lightcraft_raw::profile::ToneCurve;
let dng = crate::tests_xmp::synthetic_dng_with(None, Default::default());
let (_, plain) = crate::files::load_bytes(&dng, 64).unwrap();
assert_eq!(plain.default_tone, None);
let (_, info) = crate::files::load_bytes_with(&dng, 64, Some(&swapping_profile("Swap"))).unwrap();
assert_eq!(info.default_tone, Some(0.0));
let mut curved = swapping_profile("Curved");
curved.color.profile.tone_curve = ToneCurve::from_tag(&[0.0, 0.0, 0.18, 0.45, 1.0, 1.0]);
assert_eq!(crate::files::load_bytes_with(&dng, 64, Some(&curved)).unwrap().1.default_tone, None);
let on = |p: Process| DevelopSettings { process: p.version(), ..Default::default() };
let (v7, v17) =
(lightcraft_pipeline::finish::base_tone(&on(Process::V7), &info, 1.0), lightcraft_pipeline::finish::base_tone(&on(Process::V18), &info, 1.0));
let lr = lightcraft_pipeline::default_tone::curve(0.0).unwrap();
assert!((v17.apply(0.18) - lr.apply(0.18)).abs() < 0.01, "{} vs {}", v17.apply(0.18), lr.apply(0.18));
assert!((v7.apply(0.18) - lr.apply(0.18)).abs() > 0.01, "V7 keeps the file's own tone: {}", v7.apply(0.18));
}

#[test]
fn import_choose_cache_persist_and_delete() {
let dir = temp_dir("session");
Expand Down
67 changes: 53 additions & 14 deletions crates/gpu/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ const FIELDS: &[(&str, usize)] = &[
("SRGB_OFF", 1),
("CURVE_OFF", 1),
("CURVES", 1),
("STAGE", 1),
("STAGE_OFF", 1),
("STAGE_REFINE", 1),
("MSTAGE", 1),
("MSTAGE_OFF", 1),
("MGRADE", 1),
("MGRADE_OFF", 1),
("RGB_TONE", 1),
("STAGE_WHITES", 1),
("GAIN", 1),
("EV", 1),
("AIR", 1),
Expand Down Expand Up @@ -296,20 +305,40 @@ pub fn finish_block(fp: &FinishParams, masks: &[[f32; MASK_TERMS]], present: &Pr
let srgb_off = aux.len();
aux.extend_from_slice(&srgb_lut()[..]);
let curve_off = aux.len();
if let Some(c) = &fp.curves {
for l in c {
if l.v.len() != CURVE_N as usize {
// a wrong-length curve would shift every later aux offset (CURVE_OFF, MASK_OFF and
// the mask terms that follow) and make the kernel read the wrong data. `fail()`
// records the failure on this thread so the render falls back to the CPU; the
// partial `(p, aux)` returned here is never bound to a pipeline.
fail(FailKind::Fatal, format!("curve table has {} entries, expected {}", l.v.len(), CURVE_N));
// `p` is only assembled below the curve loop, so an empty block is as good as any:
// the caller (render.rs) gates on `failed()` right after this returns and bails to
// the CPU fallback before indexing `p` or uploading `aux`.
return (Vec::new(), aux);
}
aux.extend_from_slice(&l.v);
let stage_off = curve_off + fp.curves.as_ref().map_or(0, |c| c.len() * CURVE_N as usize);
// process V18's stage (red, green, blue, then the base table) or the earlier processes' curves
// (and Whites alone after the base table, when Refine Saturation needs it)
let tables = fp.curves.iter().flatten().chain(fp.curve_stage.iter().flat_map(|c| c.chan.iter().chain([&c.base]).chain(c.whites.iter())));
for l in tables {
if l.v.len() != CURVE_N as usize {
// a wrong-length curve would shift every later aux offset (CURVE_OFF, MASK_OFF and
// the mask terms that follow) and make the kernel read the wrong data. `fail()`
// records the failure on this thread so the render falls back to the CPU; the
// partial `(p, aux)` returned here is never bound to a pipeline.
fail(FailKind::Fatal, format!("curve table has {} entries, expected {}", l.v.len(), CURVE_N));
// `p` is only assembled below the curve loop, so an empty block is as good as any:
// the caller (render.rs) gates on `failed()` right after this returns and bails to
// the CPU fallback before indexing `p` or uploading `aux`.
return (Vec::new(), aux);
}
aux.extend_from_slice(&l.v);
}
// process V18's mixer stage: its 9 chroma and 3 lightness keys, then its table
let mstage_off = aux.len();
if let Some(cs) = &fp.mixer_stage {
aux.extend(cs.chroma.iter().flatten());
aux.extend_from_slice(&cs.light);
aux.extend_from_slice(&cs.table[..]);
}
// process V18's Colour Grading: the Luminance curve, then per wheel its tint, damping and profile
let mgrade_off = aux.len();
let mgrade = fp.ops.measured_grading.as_ref();
if let Some(g) = mgrade {
aux.extend_from_slice(&g.lum);
for w in &g.wheels {
aux.extend_from_slice(&w.tint);
aux.extend(w.damping.iter().flatten());
aux.extend_from_slice(&w.profile);
}
}
let mask_off = aux.len();
Expand Down Expand Up @@ -358,6 +387,16 @@ pub fn finish_block(fp: &FinishParams, masks: &[[f32; MASK_TERMS]], present: &Pr
p.u("SRGB_OFF", srgb_off as u32);
p.u("CURVE_OFF", curve_off as u32);
p.b("CURVES", fp.curves.is_some());
p.b("STAGE", fp.curve_stage.is_some());
p.u("STAGE_OFF", stage_off as u32);
p.f("STAGE_REFINE", fp.curve_stage.as_ref().map_or(1.0, |c| c.refine));
p.b("MSTAGE", fp.mixer_stage.is_some());
p.u("MSTAGE_OFF", mstage_off as u32);
// 0: off, else 1 + the number of wheels with a tint
p.u("MGRADE", mgrade.map_or(0, |g| 1 + g.wheels.len() as u32));
p.u("MGRADE_OFF", mgrade_off as u32);
p.b("RGB_TONE", fp.rgb_tone);
p.b("STAGE_WHITES", fp.curve_stage.as_ref().is_some_and(|c| c.whites.is_some()));
p.f("REFINE_SAT", fp.refine_sat);
p.f("GAIN", fp.gain);
p.f("EV", fp.ev);
Expand Down
Loading