Skip to content

LR-EDIT-LIGHT-HIGHLIGHTS: keep local contrast under Highlights and Shadows - #645

Merged
bflatastic merged 1 commit into
storytold:mainfrom
radialmonster:highlights-keep-detail
Oct 11, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
radialmonster:highlights-keep-detail

Conversation

@radialmonster

@radialmonster radialmonster commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Highlights no longer flattens the detail in bright areas, and Shadows no longer flattens it in dark areas. Fixes #634 (reported in #632).

What was wrong

Both sliders shift tone in log luminance according to an edge-aware base layer (crates/pipeline/src/local.rs, fast guided filter). The guided filter keeps any edge stronger than about 0.6 EV, however thin. So twigs, trim and wires against a bright sky end up in the base, and get a different shift than the sky around them.

  • In the bright pixels of a CC0 Nikon D5 file (raw.pixls.us 2218), the base carried 78 % of the 9 × 9 log-luminance detail.
  • At Highlights −100 the shift falls about 0.45 EV per EV of base, so it removed 40 % of that detail. Bright skies and walls came out dull and flat instead of recovered.

Change

The base is now the same guided filter run on a median of log luminance:

  • The median: along rows, then columns, with a radius of 0.15 % of the long edge (8 px at 5568 px, capped at 24). A median removes features thinner than its radius but keeps the steps between regions exactly where they are. So thin detail takes the same shift as its surroundings, and edges stay sharp.
  • Effect on 2218: the base now carries 8 % of the detail, and the shift removes 3 %.
  • CPU: median_hv (a sliding sorted window) and tone_base in crates/pipeline/src/local.rs.
  • GPU: median_h / median_v kernels in crates/gpu/src/wgsl/blur.wgsl, wired in through render.rs / ctx.rs. The median is a pure selection, so the CPU and GPU paths agree exactly. The GPU equivalence tests pass, max 1 LSB at 3000 × 2000.
  • Untouched when unused: with Highlights and Shadows at 0, no base is computed, and renders are bit-identical to main on all 10 files below.

Measurements

Pixels between 80 % and 98.5 % brightness (bright) or below 20 % (dark) in the unedited render. "Detail" is the standard deviation of a 9 × 9 high-pass of luminance, divided by the region's mean. Renders are 4000 px.

CC0 file Highlights −100 bright detail, main → this PR Exposure −1 (reference) Shadows +100 dark detail, main → this PR
Nikon D5 (2218) 0.058 → 0.080 0.083 0.190 → 0.228
Pentax 645D (2401) 0.098 → 0.148 0.127 0.126 → 0.148
Fujifilm GFX 50S (1435) 0.106 → 0.124 0.129 0.335 → 0.384
Fujifilm X-E2 (937) 0.166 → 0.166 0.171 0.279 → 0.323

Results on the other files tested (Leica V-Lux 4, Samsung S7, Ricoh GR III, Sigma sd Quattro and Quattro H, OM System OM-1):

  • Bright detail at Highlights −100 is the same as main or higher on every one, for example Sigma H 0.029 → 0.041 and OM-1 0.067 → 0.091.
  • Bright means stay within 0.01 of main wherever the bright area is substantial.
  • Midtones move by 1 % at most.
  • Halos: flat pixels 2–6 px from a strong edge, compared with flat pixels far from any edge at the same level, stay within about ±0.01 EV of main. I also looked at the 2218 roofline and siding and at a backlit snow scene: no visible rims.
2218: no edit, main Highlights -100, this PR Highlights -100, Exposure -1

From left to right: no edit, main at Highlights −100, this PR at Highlights −100, and Exposure −1 for reference. Sky with twigs at the top, gable wall at the bottom. 2218 is a "lossy after split" NEF that main can't decode yet, so these renders use #633's decoder; this PR doesn't include that change.

Tests

crates/pipeline/src/tests_tone.rs adds six tests:

  • Bright twigs: a synthetic bright patch with clustered twigs keeps over 0.9 of Exposure's twig contrast at Highlights −100. Main keeps 0.73.
  • Dark twigs: the same at Shadows +100, against 0.75 on main.
  • Halos: a flat bright/dark step edge shows no halo.
  • Zero settings: no base is computed when both sliders are at 0.
  • Median: the median keeps steps and matches a plain per-pixel median.

The contrast tests fail with the median turned off.

The full workspace test run (--no-fail-fast, with craft-fonts) passes, apart from two existing failures:

Process V2 (after review)

This now ships as a new rendering process, as docs/process-versions.md requires:

  • New process: Process::V2 (version 2) is added and made LATEST. New photos and Reset get it. Existing edits stay on V1 until Photo ▸ Update to Current Process, and settings saved without the field still load as V1.
  • V1 is frozen: local::tone_base_detail is 0 under V1, so tone_base is exactly the old guided_fast(l, sigma, BASE_EPS). A test checks this bit for bit. On Pentax 645D 2401 at 4000 px, main and this branch with {"process":1} give identical files for plain, Highlights −100 and Shadows +100.
  • V2: the median-prefiltered base, in both CPU local::prepare and the GPU prepare. GPU and CPU agree to within 1 LSB at 720 and 2400 px on both processes.
  • Cache key: the base plane is keyed on (sigma, process, median radius) (local::BaseKey). A test switches a warm cache between V1 and V2, and fails without the process in the key.
  • 2401 at Highlights −100, bright relative detail: V1/main 0.095 → V2 0.147 (Exposure −1: 0.124). At Shadows +100, dark relative detail goes 0.126 → 0.148. Halos are unchanged.
  • RENDER_CACHE_VERSION is 43, past main's 37. Our other open PRs use 38–42, so each is distinct and none can merge silently onto another's number.

Trade-offs

  • Thin bright features: anything thinner than about two median radii, such as a white railing or small glints, now takes its surroundings' shift instead of being pulled down by Highlights on its own.
  • Midtones: they drop by about 1 % (0.371 → 0.367 on 2218), because dark twigs inside a bright sky now come down with it.
  • Speed: the base step takes about 130 ms instead of 30 ms at 20 MP. It's cached per image and size, not recomputed per slider move.

RENDER_CACHE_VERSION is 43 here (main is 37), so adjust it at merge.

@AlexChambers

Copy link
Copy Markdown
Contributor

Supporting data for this, from my Lightroom 9.5.1 measurements on Sony A7CR raws (exports only, exploratory), with one caveat on how far to take it:

  • Lightroom doesn't only keep fine contrast under Highlights, it can expand it, depending on how much dark content is in the frame. I held a fixed 512×512 cloud window and grew the surrounding crop. At Highlights −50 the window's fine-detail amplitude, relative to its own Neutral, went: pure sky 1.00 (no change at all), + tree tops 1.15, + trees and houses 1.62, + ground 1.98, full frame 2.12. The window's darkening grew alongside it (−0.0006 → −0.18 stop).
  • That expansion is gated. Across 49 regions in 11 photos it showed up only in frames without sensor clipping whose brightest content sits within about 1 to 1.75 stops of the tone curve's top (leave-one-photo-out accuracy 0.88). Clipped frames never expanded.

So #645 moves in the right direction: not flattening is the necessary first step. Matching Lightroom on unclipped frames with dark surroundings would eventually mean adding detail, not just keeping it. That's a separate, measured step for later.

@echelon

echelon commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thank you @radialmonster! The median before the guided filter fixes #632/#634 nicely, the CPU and GPU medians match exactly, and the measurements are convincing.

It changes how every existing edit with Highlights or Shadows renders, so under the process-version rule from #533 (now on main) it needs to ship as part of Process::V2. Use tone_base with the median only for V2 and later, in local::prepare and in the GPU prepare, and add the process to the base-plane cache key (see docs/process-versions.md).

One trap: the PR sets RENDER_CACHE_VERSION = 32, which main has already reached, so it merges with no conflict and leaves stale thumbnails. Please set it past main's when you rebase. #598, #613 and #629 are waiting on V2 too.

Please join our Discord if you haven't already: https://discord.gg/artcraft

@radialmonster
radialmonster force-pushed the highlights-keep-detail branch from f5fd63f to d4e3ebc Compare October 10, 2026 07:54
@radialmonster

Copy link
Copy Markdown
Contributor Author

@echelon thanks for the review. It's rebased onto main and reworked as Process::V2:

Details are in the updated description.

@rock-meister

Copy link
Copy Markdown
Contributor

Tried this on 1917 Sony ILCE-7RM4 photos from a Lightroom catalog (main 5436951 + #645): local contrast vs Lightroom's exports goes 0.950 → 0.960 in bright areas with Highlights ≤ −50 (1.0 = Lightroom's) and 1.034 → 1.042 in dark areas with Shadows ≥ +40 (slightly over), with no photo's overall look changing by more than 1 ΔE. Details in #523.

@rock-meister

Copy link
Copy Markdown
Contributor

Note: these numbers are from the revision before the Process::V2 rework (f5fd63f). With V2, imported edits stay on V1 and render unchanged, so this applies to photos set to V2.

…s, as process V2 (storytold#632)

The highlights/shadows base (fast guided filter of log luminance, eps 0.35)
followed thin high-contrast detail, so the per-pixel shift flattened twigs,
lines and texture in bright areas (and dark ones under Shadows); Exposure
kept them.

This changes how every existing edit with Highlights or Shadows renders, so
it ships as a new rendering process (docs/process-versions.md):

- Process::V2 (version 2) is added and made LATEST. New photos and Reset get
  it; existing edits stay on V1 until Update to Current Process. Settings
  saved without the field still load as V1.
- From V2 the base is the same guided filter of a separable median of log
  luminance (radius 0.15 % of the long edge, <= 24 px): fine detail takes its
  surroundings' shift and keeps its contrast, region steps stay put (no new
  halos). V1's base is untouched: local::tone_base_detail is 0 under V1 and
  tone_base then is exactly guided_fast(l, sigma, BASE_EPS), as before.
- CPU (local::prepare) and GPU prepare (median_h / median_v kernels, bit for
  bit with the CPU median) both branch on it via PlaneSigmas::base_detail.
- The base plane's cache key is now (sigma, process, median radius)
  (local::BaseKey), so a warm cache never serves one process the other's
  base. plane_at is shared with the GPU crate.
- finish::base_tone: V2 uses V1's tone map.

Tests: V2 keeps twig/local contrast (>= 0.9 of Exposure's) with no halo; V1
plane sigmas have no median and its base equals guided_fast bit for bit; V1
and V2 render alike without Highlights/Shadows; warm-cache renders across
V1/V2 switches equal fresh ones (fails if the key drops the process); GPU
matches CPU on both processes at 720 and 2400 px, cached and not.

Pentax 645D 2401 at 4000 px: main and V1 renders bit-identical (plain,
Highlights -100, Shadows +100). Highlights -100 bright rel. detail
0.095 (V1) -> 0.147 (V2), Exposure -1: 0.124; Shadows +100 dark rel. detail
0.126 -> 0.148.

RENDER_CACHE_VERSION 54 (adjust at merge).
@radialmonster

Copy link
Copy Markdown
Contributor Author

Rebased onto main (b70ae17) to clear the conflicts. They were only RENDER_CACHE_VERSION, now 54 (past every open PR's number), and the Highlights/Shadows rows in docs/parity.md, where I kept main's newer Highlights text and added the V2 sentence. cargo fmt --check, clippy -D warnings (pipeline, gpu, develop, engine), the pipeline/gpu/develop tests and cargo xtask parity pass.

Copy link
Copy Markdown
Member

Landed in #981 together with your #689, #694, #700, #734, #750, #794 and #854. Thank you, @radialmonster! Process V2 also keeps #877's HDR camera curve, and #762 / #514 are being asked to move onto it.


Generated by Claude Code

AER00 added a commit to AER00/lightcraft that referenced this pull request Oct 11, 2026
The tone work from storytold#146/storytold#196 changes how every existing raw edit renders, so
it goes behind a process version (docs/process-versions.md): V2 is the measured
rendering and LATEST; V1 keeps the pre-branch rendering exactly.

- Process::V2 added, LATEST; ALL is [V1, V2]. V2 is shared with the
  Highlights/Shadows base (storytold#645) and the sharpening (storytold#762) landing in the same
  batch, so a photo that updates to V2 gets the whole measured look at once.
- finish::base_tone: V1's arm calls tone::ToneMap::{camera_v1, hdr_v1}, the old
  model restored verbatim (neutral base curve, extended-Reinhard shoulder,
  Blacks as the curve's toe, Whites as a display-domain lift); V2's arm is the
  measured model. A display-referred source uses display_hdr in both.
- FinishParams::blacks is Blacks::IDENTITY for V1, and the per-photo Whites
  statistic is measured only for V2 (Process::is_measured_tone) -- V1 pays for
  neither.
- RENDER_CACHE_VERSION 48 -> 49.
- docs: process-versions.md describes V1/V2 and records that the V2 constants
  are fitted to the reference developer's observed output only (its rendered
  images; no bundle, profile, preset or Adobe asset); parity.md, ROADMAP.md and
  gpu-pipeline.md name V2 / F_PER_CHANNEL.

Tests: v2_is_not_v1 pins the default curve apart; the v1_* golden tests pin the
frozen model; stored_process_numbers_render_with_a_known_process now asserts
the two arms render a raw differently and a rendered source alike.

cargo xtask ci: all 8 steps green (fmt, clippy, heif, test, parity, layers,
assets, wasm).
AER00 added a commit to AER00/lightcraft that referenced this pull request Oct 11, 2026
Takes the branch onto the 346 commits main landed since b70ae17, including its
own Process::V2 (storytold#632: Highlights and Shadows keep the local contrast of the
tones they move) and the progress-doc restructure (parity.md ->
parity-checklist.md, "Where we stand" -> target-app-parity.md, milestones and
risks -> roadmap.md).

Resolutions:

- Process: main's V2 and this branch's measured tone model share one V2, as
  agreed with the Highlights/Shadows (storytold#645) and sharpening (storytold#762) work. The
  Process::V2 doc comment and docs/process-versions.md say so.
- finish::base_tone keeps V1 frozen (main's tone map) and gives V2 the measured
  model, now HDR-aware on the camera path too (ToneMap::camera_scaled_hdr), so
  an HDR render keeps the file's camera look. Process::is_measured_tone gates
  the Blacks curve and the per-photo Whites statistic; local::tone_base_detail
  gates storytold#632's median base.
- The camera-look fitter keeps scoring its candidates with the frozen V1 tone
  map (ToneMap::{camera_v1, hdr_v1}). The model a fit is scored with decides
  which files accept a look -- the source stage, which the process version does
  not reach; the fit's own test (a_black_and_white_jpeg_gives_its_tone_curve)
  asserts the default curve is darker, which V2's measured curve is not.
- crates/pipeline/src/spots.rs: chunks_exact(3) -> as_chunks::<3>() for the
  clippy lint rustc 1.98 added (main's new line; the local gate is -D warnings).
- RENDER_CACHE_VERSION 60 -> 61 (the branch's look changes on top of main).
- Docs merged: parity-checklist.md (the five Light rows, the storytold#632 note on
  Highlights/Shadows, LR-PROF-CAMERACOLOR and LR-BEHAV-RENDER-FIDELITY),
  process-versions.md (V1/V2 as one batch), roadmap.md (Look parity bullet),
  gaps.md (gap 3 is no longer "render fidelity unmeasured").

cargo xtask ci: all 8 steps green (fmt, clippy, heif, test, parity, layers,
assets, wasm).
AlexChambers added a commit to AlexChambers/lightcraft that referenced this pull request Oct 13, 2026
…t's single-slider responses against Lightroom exports

A shareable render-fidelity measurement for gap 3 (docs/render-fidelity.md).
It compares a user's own Lightroom TIFF exports with LightCraft renders of
the same recipes from the same raws. It reads no Adobe application file,
profile, preset or table, keeps only the names of an export's profile and
look, and the Lightroom presets it writes are generated from the recipe
values. It needs numpy and tifffile (tools/requirements-render-fidelity.txt)
and the standard library.

- plan: Lightroom develop presets for Basic-slider recipes (default: the
  Neutral and every Basic slider at two amounts) and export instructions:
  one export operation into one new folder per session, 16-bit sRGB TIFF,
  All Metadata.
- pair: reads each export's embedded XMP and checks the clean recipe
  affirmatively (the settings the measurement depends on stated,
  everything else neutral, identity curves, Adobe Standard / Adobe Color,
  no crop or local edits). Finds the raw by crs:RawFileName and identifies
  photos by the raw's sha256; refuses a raw whose own XMP, read where
  LightCraft's reader reads it, carries develop settings. Pairs each
  single-slider export with a Neutral, else the same slider's smallest
  other amount, from the same session (export folder and time segment)
  and size. Photos split into tune and check by hash.
- render: measures a private copy of the given lightcraft-cli. Each raw is
  first checked with LightCraft's own importer (run --import, develop.get,
  develop.reset, develop.get: any changed field refuses it). Renders the
  Basic panel from the export's XMP with sharpening, noise reduction and
  lens-profile corrections off, from a sidecar-free symlink, 16-bit sRGB
  at the export's long edge, registers every reference export by a
  consensus shift search and samples both engines on a grid. Every sample
  and registration carries its provenance (the run's binding id, CLI and
  tool hashes, the raw, the recipe or export, frame and shift); a
  run-folder lock, exclusive manifest creation and identity checks before
  each write keep concurrent renders apart. CLI calls have time limits;
  any failure is recorded for its photo and retried on resume.
- score: per band of Lightroom's reference luminance, LightCraft's share
  of Lightroom's log-luminance response, the signed bias, the
  per-position error, CIE76 dE, the colour-change error, clipping and
  black transitions both ways, support retention and out-of-support
  errors, with contributor counts, tune and check apart. A pair is scored
  only when its raw passed the importer check, its samples' and
  registration's provenance matches the manifest and the pair, and its
  two Lightroom exports are framed alike; every other pair is listed with
  its reason.
- report: a Markdown summary to paste into an issue: numbers only, photos
  under per-run salted labels, and a CSV appendix of every band and
  transition.
- selftest: the XMP, clean-recipe and pairing rules, registration, the
  scoring maths, the raw guard, run-state validation and a 20-mode CLI
  fault matrix on synthetic data; with --cli, the raw guard and the
  importer check against that build's own XMP reader.

On three of the maintainers' photos with main 76b5377, it pairs the 34
pairs their private scripts scored identically and reproduces all 7158
statistics exactly.

docs/gaps.md gap 3 and the LR-BEHAV-RENDER-FIDELITY row in
docs/parity-checklist.md say what exists and what is still missing; gap 3
no longer says only process V1 exists (V2 landed in storytold#645). cargo xtask
assets and parity pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AlexChambers added a commit to AlexChambers/lightcraft that referenced this pull request Oct 14, 2026
…t's single-slider responses against Lightroom exports

A shareable render-fidelity measurement for gap 3 (docs/render-fidelity.md).
It compares a user's own Lightroom TIFF exports with LightCraft renders of
the same recipes from the same raws. It reads no Adobe application file,
profile, preset or table, keeps only the names of an export's profile and
look, and the Lightroom presets it writes are generated from the recipe
values. It needs numpy and tifffile (tools/requirements-render-fidelity.txt)
and the standard library.

- plan: Lightroom develop presets for Basic-slider recipes (default: the
  Neutral and every Basic slider at two amounts) and export instructions:
  one export operation into one new folder per session, 16-bit sRGB TIFF,
  All Metadata.
- pair: reads each export's embedded XMP and checks the clean recipe
  affirmatively (the settings the measurement depends on stated,
  everything else neutral, identity curves, Adobe Standard / Adobe Color,
  no crop or local edits). Finds the raw by crs:RawFileName and identifies
  photos by the raw's sha256; refuses a raw whose own XMP, read where
  LightCraft's reader reads it, carries develop settings. Pairs each
  single-slider export with a Neutral, else the same slider's smallest
  other amount, from the same session (export folder and time segment)
  and size. Photos split into tune and check by hash.
- render: measures a private copy of the given lightcraft-cli. Each raw is
  first checked with LightCraft's own importer (run --import, develop.get,
  develop.reset, develop.get: any changed field refuses it). Renders the
  Basic panel from the export's XMP with sharpening, noise reduction and
  lens-profile corrections off, from a sidecar-free symlink, 16-bit sRGB
  at the export's long edge, registers every reference export by a
  consensus shift search and samples both engines on a grid. Every sample
  and registration carries its provenance (the run's binding id, CLI and
  tool hashes, the raw, the recipe or export, frame and shift); a
  run-folder lock, exclusive manifest creation and identity checks before
  each write keep concurrent renders apart. CLI calls have time limits;
  any failure is recorded for its photo and retried on resume.
- score: per band of Lightroom's reference luminance, LightCraft's share
  of Lightroom's log-luminance response, the signed bias, the
  per-position error, CIE76 dE, the colour-change error, clipping and
  black transitions both ways, support retention and out-of-support
  errors, with contributor counts, tune and check apart. A pair is scored
  only when its raw passed the importer check, its samples' and
  registration's provenance matches the manifest and the pair, and its
  two Lightroom exports are framed alike; every other pair is listed with
  its reason.
- report: a Markdown summary to paste into an issue: numbers only, photos
  under per-run salted labels, and a CSV appendix of every band and
  transition.
- selftest: the XMP, clean-recipe and pairing rules, registration, the
  scoring maths, the raw guard, run-state validation and a 20-mode CLI
  fault matrix on synthetic data; with --cli, the raw guard and the
  importer check against that build's own XMP reader.

On three of the maintainers' photos with main 76b5377, it pairs the 34
pairs their private scripts scored identically and reproduces all 7158
statistics exactly.

docs/gaps.md gap 3 and the LR-BEHAV-RENDER-FIDELITY row in
docs/parity-checklist.md say what exists and what is still missing; gap 3
no longer says only process V1 exists (V2 landed in storytold#645). cargo xtask
assets and parity pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AlexChambers added a commit to AlexChambers/lightcraft that referenced this pull request Oct 15, 2026
…t's single-slider responses against Lightroom exports

A shareable render-fidelity measurement for gap 3 (docs/render-fidelity.md).
It compares a user's own Lightroom TIFF exports with LightCraft renders of
the same recipes from the same raws. It reads no Adobe application file,
profile, preset or table, keeps only the names of an export's profile and
look, and the Lightroom presets it writes are generated from the recipe
values. It needs numpy and tifffile (tools/requirements-render-fidelity.txt)
and the standard library.

- plan: Lightroom develop presets for Basic-slider recipes (default: the
  Neutral and every Basic slider at two amounts) and export instructions:
  one export operation into one new folder per session, 16-bit sRGB TIFF,
  All Metadata.
- pair: reads each export's embedded XMP and checks the clean recipe
  affirmatively (the settings the measurement depends on stated,
  everything else neutral, identity curves, Adobe Standard / Adobe Color,
  no crop or local edits). Finds the raw by crs:RawFileName and identifies
  photos by the raw's sha256; refuses a raw whose own XMP, read where
  LightCraft's reader reads it, carries develop settings. Pairs each
  single-slider export with a Neutral, else the same slider's smallest
  other amount, from the same session (export folder and time segment)
  and size. Photos split into tune and check by hash.
- render: measures a private copy of the given lightcraft-cli. Each raw is
  first checked with LightCraft's own importer (run --import, develop.get,
  develop.reset, develop.get: any changed field refuses it). Renders the
  Basic panel from the export's XMP with sharpening, noise reduction and
  lens-profile corrections off, from a sidecar-free symlink, 16-bit sRGB
  at the export's long edge, registers every reference export by a
  consensus shift search and samples both engines on a grid. Every sample
  and registration carries its provenance (the run's binding id, CLI and
  tool hashes, the raw, the recipe or export, frame and shift); a
  run-folder lock, exclusive manifest creation and identity checks before
  each write keep concurrent renders apart. CLI calls have time limits;
  any failure is recorded for its photo and retried on resume.
- score: per band of Lightroom's reference luminance, LightCraft's share
  of Lightroom's log-luminance response, the signed bias, the
  per-position error, CIE76 dE, the colour-change error, clipping and
  black transitions both ways, support retention and out-of-support
  errors, with contributor counts, tune and check apart. A pair is scored
  only when its raw passed the importer check, its samples' and
  registration's provenance matches the manifest and the pair, and its
  two Lightroom exports are framed alike; every other pair is listed with
  its reason.
- report: a Markdown summary to paste into an issue: numbers only, photos
  under per-run salted labels, and a CSV appendix of every band and
  transition.
- selftest: the XMP, clean-recipe and pairing rules, registration, the
  scoring maths, the raw guard, run-state validation and a 20-mode CLI
  fault matrix on synthetic data; with --cli, the raw guard and the
  importer check against that build's own XMP reader.

On three of the maintainers' photos with main 76b5377, it pairs the 34
pairs their private scripts scored identically and reproduces all 7158
statistics exactly.

docs/gaps.md gap 3 and the LR-BEHAV-RENDER-FIDELITY row in
docs/parity-checklist.md say what exists and what is still missing; gap 3
no longer says only process V1 exists (V2 landed in storytold#645). cargo xtask
assets and parity pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emmertex added a commit to Kaan88/lightcraft that referenced this pull request Oct 27, 2026
Library: search boxes in the Metadata columns and the People view (carries storytold#643)
AlexChambers added a commit to AlexChambers/lightcraft that referenced this pull request Oct 28, 2026
…t's single-slider responses against Lightroom exports

A shareable render-fidelity measurement for gap 3 (docs/render-fidelity.md).
It compares a user's own Lightroom TIFF exports with LightCraft renders of
the same recipes from the same raws. It reads no Adobe application file,
profile, preset or table, keeps only the names of an export's profile and
look, and the Lightroom presets it writes are generated from the recipe
values. It needs numpy and tifffile (tools/requirements-render-fidelity.txt)
and the standard library.

- plan: Lightroom develop presets for Basic-slider recipes (default: the
  Neutral and every Basic slider at two amounts) and export instructions:
  one export operation into one new folder per session, 16-bit sRGB TIFF,
  All Metadata.
- pair: reads each export's embedded XMP and checks the clean recipe
  affirmatively (the settings the measurement depends on stated,
  everything else neutral, identity curves, Adobe Standard / Adobe Color,
  no crop or local edits). Finds the raw by crs:RawFileName and identifies
  photos by the raw's sha256; refuses a raw whose own XMP, read where
  LightCraft's reader reads it, carries develop settings. Pairs each
  single-slider export with a Neutral, else the same slider's smallest
  other amount, from the same session (export folder and time segment)
  and size. Photos split into tune and check by hash.
- render: measures a private copy of the given lightcraft-cli. Each raw is
  first checked with LightCraft's own importer (run --import, develop.get,
  develop.reset, develop.get: any changed field refuses it). Renders the
  Basic panel from the export's XMP with sharpening, noise reduction and
  lens-profile corrections off, from a sidecar-free symlink, 16-bit sRGB
  at the export's long edge, registers every reference export by a
  consensus shift search and samples both engines on a grid. Every sample
  and registration carries its provenance (the run's binding id, CLI and
  tool hashes, the raw, the recipe or export, frame and shift); a
  run-folder lock, exclusive manifest creation and identity checks before
  each write keep concurrent renders apart. CLI calls have time limits;
  any failure is recorded for its photo and retried on resume.
- score: per band of Lightroom's reference luminance, LightCraft's share
  of Lightroom's log-luminance response, the signed bias, the
  per-position error, CIE76 dE, the colour-change error, clipping and
  black transitions both ways, support retention and out-of-support
  errors, with contributor counts, tune and check apart. A pair is scored
  only when its raw passed the importer check, its samples' and
  registration's provenance matches the manifest and the pair, and its
  two Lightroom exports are framed alike; every other pair is listed with
  its reason.
- report: a Markdown summary to paste into an issue: numbers only, photos
  under per-run salted labels, and a CSV appendix of every band and
  transition.
- selftest: the XMP, clean-recipe and pairing rules, registration, the
  scoring maths, the raw guard, run-state validation and a 20-mode CLI
  fault matrix on synthetic data; with --cli, the raw guard and the
  importer check against that build's own XMP reader.

On three of the maintainers' photos with main 76b5377, it pairs the 34
pairs their private scripts scored identically and reproduces all 7158
statistics exactly.

docs/gaps.md gap 3 and the LR-BEHAV-RENDER-FIDELITY row in
docs/parity-checklist.md say what exists and what is still missing; gap 3
no longer says only process V1 exists (V2 landed in storytold#645). cargo xtask
assets and parity pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Highlights slider flattens detail in bright areas (raws and 16-bit TIFF lose 30-40 % local contrast)

5 participants