Skip to content

LR-EDIT-AUTO: Lightroom-like Auto, calibrated on Lightroom's Auto results - #628

Merged
echelon merged 1 commit into
storytold:mainfrom
AlexChambers:lightroom-like-auto
Oct 10, 2026
Merged

echelon merged 1 commit into
storytold:mainfrom
AlexChambers:lightroom-like-auto

Conversation

@AlexChambers

Copy link
Copy Markdown
Contributor

Addresses #318 ("won't do a proper auto correction") and the Auto half of #209 (Auto + Clarity looks much worse than Lightroom).

Why

Auto (develop.auto, crates/pipeline/src/auto.rs) was a short percentile rule. On 24 Sony raw photos, it set Exposure about 1.4 EV higher than Lightroom's Auto on average (+1.81 against +0.44 EV) and barely used Shadows. Its results were about 18 L* brighter than Lightroom's Auto results, and further from them than the unedited render (median dE76 22.02 against 7.92).

What

Auto now follows the shape of Lightroom's rule, with values chosen so that our results match its results (our sliders have their own scales, so copying its numbers is not the goal):

Auto only applies when someone asks for it, so existing edits keep their look. HDR merges with Auto Settings use the same rule.

How it was fitted and tested

Targets. The targets are Lightroom 9.5.1's observed behaviour, measured black-box: the values its Auto chose and its exported results on the 24 photos of the owner's study 119, with the matching exports from probe 529. No Adobe files are read. This is the same approach as #514; the owner has asked the maintainer about it on #146.

Metric. Probe 529's metric: 16-bit sRGB exports at 2048 px, CIELab D65 after a 1.7 px Gaussian, whole frame minus a 12 px border, mean dE76 and mean dL*.

DRO. Sony's in-camera DRO brightens the camera JPEG our starting look is fitted to, so 8 of the 24 photos start brighter than they should (#568 fixes that separately). The rule is fitted only on the 16 DRO-off photos, and every result is reported per group.

Held-out validation (leave one out). For each of the 24 photos:

  • The Exposure slope, the fixed Highlights and Shadows, and the starting point of the fit all come from the other 23 photos' Lightroom values only.
  • The exposure offset, Contrast and Vibrance are then fitted on our renders (1024 px) of the DRO-off photos other than it.
  • The photo is rendered and scored at 2048 px with that fold's values.
  • The shipped values are the same fit on all 16 DRO-off photos.
Photos Arm median dE76 mean dE76 mean dL*
DRO off (16) unedited 8.28 9.01 -4.74
current Auto 18.81 18.92 +15.73
new Auto, held out 6.38 6.90 -0.54
new Auto, shipped values 6.08 6.65 -0.64
DRO on (8) unedited 7.00 7.33 -0.67
current Auto 24.01 26.07 +23.72
new Auto, held out 9.39 10.91 +8.55
All (24) unedited 7.92 8.45 -3.38
current Auto 22.02 21.30 +18.39
new Auto, held out 7.70 8.23 +2.49

What this shows:

  • DRO-off photos: the held-out Auto is closer to Lightroom's Auto than the unedited render on 12 of the 16. Their mean Exposure is +0.18 EV against Lightroom's +0.26 (the old rule chose +1.47). Across all 24, it's +0.35 against +0.44 (correlation 0.92; within the 16 DRO-off photos alone, 0.61).

  • Where it is worse than unedited (DRO off, held out): four scenes where Lightroom's sliders largely cancel out.

    • DSC06881: 5.09 to 10.76, 7.8 L* too bright.
    • DSC06094: 5.47 to 10.26, 9.6 L* too dark.
    • DSC07837: 5.79 to 6.84.
    • DSC09065: 8.48 to 8.57.
  • DRO-on photos: only 1 of 8 is better than unedited; they end about 8.6 L* too bright, their brighter starting point showing through. LR-PROF-CAMERACOLOR: Sony ARWs shot with DRO no longer start with the camera JPEG's lifted shadows (#244) #568 should change that.

  • Parameter spread across the 24 folds:

    Exposure offset Contrast Vibrance Highlights / Shadows (fold's Lightroom averages)
    -0.64 to -0.54 62 to 75 28 to 32 -68 to -66 / 51 to 53
  • The larger rule did no better: freeing Highlights and Shadows as well (5 fitted values) gave 6.51 / 7.05 held out on the DRO-off photos, and left the parameters poorly determined across folds: Contrast 17 to 70, Highlights -69 to -39, Shadows 17 to 54. So Highlights and Shadows are taken from Lightroom instead.

Other sources (no Lightroom reference, checked for sanity), default to Auto:

Source Auto Exposure mean L* change clipped (L* > 99), default to Auto
Canon 6D CR2, Nikon D7500 NEF, Ricoh GR III DNG, Fujifilm X-T20 RAF (CC0) -0.16 to +0.19 -2.5 to +3.7 0.1% to 0% or none
Pixel 2 XL DNG (CC0) -0.43 -9.2 0.2% to 0%
Sony A7 III / A7 IV / A7R II ARW (CC0) -0.33 to -0.01 -4.0 to +1.5 up to 3.7% to 0%
JPEGs (8-bit renders of three study photos) -0.33 to +0.09 -8.5 to -2.4 2.9% to 0% on one, none added
Procedural demo photos (rendered sources) -0.87 to +0.21 -13 to -17 on the six bright scenes, -8.4 and -1.7 on the others none added (the night aurora scene's crushed blacks go from 21% to 24%)

The raws get the expected added contrast, vibrance and highlight recovery, with no more crushed blacks than before. JPEGs are already toned: their log average reads brighter, so their Exposure moves less, but Contrast +68 still darkens their midtones a little. The demo scenes' very bright skies and suns are pulled down. None of these sources was calibrated against Lightroom.

Limits

Testing

  • crates/pipeline/src/auto.rs unit tests:
    • Exposure follows the log average: middle grey gives -0.58, each EV darker adds 0.41, clamped to -2..3.
    • The rest of the recipe is fixed.
    • Half-NaN and half-infinite images (also through the proxy's resampling), and scattered broken pixels, give what the valid pixels alone give.
    • An image with no valid pixel gets Exposure 0.
  • Throttled cargo xtask ci: on origin/main 88ea1a8 (rustc 1.99, Apple M3 Max): fmt, clippy and heif pass; test fails only on the two known lightcraft-gpu denoise-runner tests (nn::tests::the_gpu_gives_what_the_reference_gives, nn::tests::a_runner_serves_many_tiles_from_many_threads), which fail the same way on main on this machine. With --no-fail-fast every other test binary passes (77), and parity, layers, assets and wasm pass when run on their own.

🤖 Generated with Claude Code

…ults (storytold#318, storytold#209)

Auto was a percentile rule that set Exposure about 1.4 EV higher than
Lightroom's Auto on the same photos (mean +1.81 against +0.44 EV) and
barely used Shadows: on 24 Sony raw photos its results were further from
Lightroom's Auto results (median dE76 22.0) than leaving the photo
unedited (7.9), about 18 L* too bright.

Auto is now Lightroom's shape of rule with values chosen for our results:
- Exposure = -0.58 - 0.41 * the scene's log-average luminance (EV from
  middle grey, scene-linear, under the photo's white balance, so it does
  not depend on the base tone curve), clamped to -2..3 EV. The slope is
  Lightroom's: its Auto's chosen Exposure against our log average, r -0.92;
- Highlights -66 and Shadows +52: Lightroom's own average Auto values;
- Contrast +68 and Vibrance +30 (our scales; our base tone is flatter);
  Whites, Blacks and Saturation 0.
The exposure offset, Contrast and Vibrance were fitted jointly so our
renders match Lightroom's Auto exports on the 16 photos whose starting
look Sony's DRO doesn't brighten (storytold#568 changes the other 8). Held out one
photo at a time, each fold fitted from its own training photos only:
median dE76 6.38 on those 16 (8.28 unedited, 18.81 with the old rule),
12 of 16 closer than unedited; 7.70 on all 24 (7.92 unedited); on the 8
DRO photos 9.39 (7.00 unedited), their brighter start showing through.
Freeing Highlights and Shadows too (5 fitted values) did no better held
out (6.51) and left them poorly determined across folds.

The log average skips pixels that aren't finite (a damaged decode) through
the proxy's resampling and white balance; with no valid pixel, Exposure 0.

Values are black-box observations of Lightroom (the settings its Auto
chose and its exports), as in storytold#514. Auto only applies when asked for, so
existing edits keep their look; HDR merges with Auto Settings use the
same rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thank you @AlexChambers! This landed in #657 with the other community PRs of this round. While merging, Auto now renders under the photo's process (#533).

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

@gschetrit

Copy link
Copy Markdown

Auto mode still does not working properly Contrast +68 and Highlights -66 tested on V0.14.0

emmertex added a commit to clydecbrown/lightcraft that referenced this pull request Oct 27, 2026
…buting

Docs: CONTRIBUTING.md, AGENTS.md as the one instruction file, PR template in line
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.

3 participants