Commit Graph
139 Commits
Author SHA1 Message Date
r3d42-git 25a43773dc Keep exact correspondence samples at invalid borders
Use coincident interpolation bounds at integer pixel centres so only contributing neighbours can propagate NaN. Clarify when a LensDB reload invalidates fitted Smart Previews.
2026-11-26 23:17:47 +01:00
r3d42-git fd17163ff7 Merge main and preserve non-CR3 correspondence geometry
Apply the measured database vignetting at sensor coordinates when an external warp is accepted. Carry aligned colour and tone samples into pooled calibration. Preserve the CR3 framing and Smart Preview source identity, and advance look and render cache versions.
2026-11-26 22:56:34 +01:00
FredApps 1e1c2c6290 Merge main (b084f79e28) into fix/lensfun-vignetting-look-fit
Conflicts:
crates/engine/src/camera_preview.rs
crates/engine/src/camera_preview/look_fit.rs
crates/engine/src/media/source.rs

Ported: the camera_preview.rs and look_fit.rs imports keep both sides' names. LOOK_VERSION stays 26, as coordinated by @AlexChambers, with main's 14-18 history kept above it. RENDER_CACHE_VERSION becomes 87 rather than the reserved 83, because main has reached 86: going back to 83 would let the next bump (84) match old caches.
2026-11-26 17:28:44 +01:00
FredApps 1800971382 Merge main (3c6a9f2c47) into camera-colour-pushed-shadows
Conflicts:
crates/engine/src/media/source.rs
docs/parity-checklist.md

Delta since approval (2630748a..91620b0f: doc cites, panic! in a test, render-cache bump) reviewed. Conflict: RENDER_CACHE_VERSION goes to 86 (main is at 85, 83 reserved by #3943), documented in main's version list.
2026-11-26 21:06:09 +07:00
r3d42-git 1fd4a492f7 Merge upstream main and preserve Smart Preview provenance 2026-11-25 09:32:55 +01:00
1b3563ddca raw, engine: demosaic full-size raws on the white-balanced mosaic (#1328)
Switch unbinned RAW development onto craft-develop's develop_balanced_masked
(craft-libs#3042, already pinned by #4670). Bump RENDER_CACHE_VERSION to 84
and stamp smart previews with SOURCE_VERSION so raw proxies refresh once.

Fixes #1328.
Part of storytold/craft-libs#778.

Co-authored-by: Alex Chambers <[email protected]>
Co-authored-by: Dylan M. Taylor <[email protected]>
2026-11-23 20:04:02 +07:00
r3d42-git 20c0943d7e Merge upstream main and retain camera profile cache invalidation 2026-11-19 14:28:14 +01:00
r3d42-gitandCodex 8d45e43cf3 LR-PROF-CAMERACOLOR: keep DNG colour fits in stored sample space
Exclude unsaved external vignette gains from non-CR3 DNG colour fitting while retaining correspondence geometry and the vignette carried by the file's own opcodes. Preserve file-local and pooled calibration.

Add causal procedural DNG coverage and retain the file-owned correction assertions in bounded test helpers. Clarify that the five-photo fixed-mount validation is historical and was not rerun on the synchronized source. Full cargo xtask ci passes with Rust 1.95.0, actual Metal and WASM; capability skips are separate.

Co-authored-by: Codex <[email protected]>
2026-11-16 22:42:25 +01:00
Martin JaniczekandClaude Opus 5.5 33cdc22af5 LR-PROF-CAMERACOLOR: leave pixels clipped in the camera JPEG out of the vignetting share
The sensor clip mask misses highlights the JPEG clips and the raw doesn't; their
JPEG brightness no longer follows the scene, so they skewed the measured share.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 14:48:05 +01:00
Martin JaniczekandClaude Opus 5.5 09e3840f1f LR-PROF-CAMERACOLOR: next free shared numbers, CR3 framing note and measurements
- LOOK_VERSION 26 and RENDER_CACHE_VERSION 83: open PRs already take
  14/77 (#758, #3902), up to 25/82 (#1206).
- look_proxies: say why a CR3's framing is now estimated on the
  uncorrected sensor, and that it came out the same as on the corrected
  one on all 22 corpus CR3s with a database profile.
- camera-preview-colour.md: the 22 corpus CR3s this changes, measured
  against their camera JPEGs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 12:55:52 +01:00
Martin Janiczek ca64d3c171 Review fixes 2026-11-11 12:55:52 +01:00
Martin JaniczekandClaude Opus 5.5 a6705ac0fe LR-PROF-CAMERACOLOR: measure the lens database vignetting share per hue class, for CR3 framing and DNG tone fits
Review follow-ups for #3941:
- camera_vignetting_amount ranks luminance within classes of similar sensor
  chromaticity (near-neutral and eight hue sectors), weighted by pixel count,
  so a camera that renders some hues brighter, gathered toward the corners,
  no longer reads as vignetting.
- A CR3 proxy moved to its JPEG's framing gets the vignetting gain of the
  position each pixel shows (framed_proxies returns the framing).
- fit_dng_tone takes a lens database profile in the share the preview shows,
  as the other raws' fits do; a file's own correction stays whole.
- Tests: hue classes, CR3 framing gains, the DNG share, a tinted fully
  corrected JPEG with and without the profile, and an informative tiny image
  for the too-few-pixels fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 12:55:52 +01:00
Martin Janiczek aec2dd1bde LR-PROF-CAMERACOLOR: lensfun vignetting no longer darkens and skews a raw's camera look (#3941)
Fixes #3941

## Problem

With the downloaded lensfun database, raws whose look LightCraft fits to
their own camera JPEG (Sony ARW and the other makes without a colour matrix)
render too dark, with colour skewed, when lensfun has a vignetting profile
for their lens: in the loupe, the thumbnails and exports alike. Without the
database the same files match their camera JPEG more closely. On the 11
affected photos measured below, the bug darkened the render by 0.4 to 17 L*
(one unchanged); its colour shifts are scene-dependent, mostly a little lost
chroma. On the ILCE-7M3 / FE 28mm F2 photo from #3941 (f/2, the worst
case) the yellow CRT text turns orange and the frame 17 L* darker.

`git bisect` (rendering each commit with and without the lens database)
points to 001a58e9 "RAW.colour: fit the per-file look on the
vignetting-corrected sensor" (LOOK_VERSION 13). Since then every per-file
fit multiplies the sensor proxy by the whole embedded vignetting correction,
on the assumption that the camera JPEG has it applied. That holds for the
file's own data (Fujifilm maker notes, DNG opcodes), but
`lens_profiles::for_raw` hands the fit a lensfun profile the same way, and a
lens database describes the lens, not what this camera did to its JPEG
relative to the raw. The #3941 JPEG shows none of the profile's correction
relative to its raw, although its maker note says vignetting correction
Auto (as with the A7CR's shading Auto JPEGs in
docs/sony-lens-corrections.md). So the fit saw corners far brighter than
the JPEG's: its held-out RMS went from 0.027 (without lensfun) to 0.062,
accepted only on the "away from edges" retry, the tone curve darkened to
compensate and the colour matrix bent. How far depends on how much of the
profile the JPEG lacks and what the scene puts in the corners.

## Change

`look_proxies` (crates/engine/src/camera_preview/look_fit.rs) keeps the
whole correction for the file's own data (`LensSource::File`, unchanged).
For a `LensSource::Database` profile it measures the share of the
correction the camera JPEG shows (`camera_vignetting_amount`) and applies
that share to the sensor proxy, scaled as the Vignetting amount slider
scales it (`1 + (gain - 1) * amount`). The camera's tone curve is monotone,
so with the share the camera applied, the corrected sensor orders its pixels
by luminance as the JPEG does: of 0 to 100 % in 5 % steps, the share with
the highest rank correlation (`rank_correlation_ties`) wins. Clipped and
non-finite pixels are left out; with fewer than 256 usable pixels, or with a
lens warp on the proxy (which a file with a database profile doesn't have),
the whole correction is kept, as before.

LOOK_VERSION 14, RENDER_CACHE_VERSION 77. Docs: camera-preview-colour.md,
lens-profiles.md, raw-parity.md (with a revision row).

**Not in this PR:**
- The render still applies a lensfun profile's vignetting correction in full
  while Enable Profile Corrections is on, so the #3941 photo's corners come
  out much brighter than in its camera JPEG (lensfun: about 2.6 EV at the
  extreme corner of this lens at f/2; the Vignetting amount slider lowers
  it). If Sony applies part of its shading correction to the raw samples (an
  open question in docs/sony-lens-corrections.md), that is a double
  correction of its own; it needs flat-field measurements, and the ARW's
  recorded shading setting and table (`0x7031`/`0x7032`) could then decide
  it.
- Sony's DRO brightens the camera JPEG's shadows locally, which could bias
  the measured share; CR3 proxies are measured in the oriented frame without
  their small framing alignment.

## How it was checked

- [x] `cargo xtask ci` on this branch, rebased on current `main` (macOS
  aarch64): fmt, clippy, heif, parity, layers, assets, roots and wasm pass;
  the tests pass except two that fail identically on unchanged `main` on
  this machine: `tests_light::v1_and_v2_render_as_before_v3` (#3788) and
  `tests::titlebar::double_click_on_the_empty_bar_zooms_then_restores`.
  The engine's corpus tests pass with the files above.
- [x] A test that fails without this change:
  `a_lens_database_vignetting_reaches_the_fit_as_far_as_the_camera_jpeg_shows_it`
  (synthetic ARW and camera JPEG, `grey_raw_with_jpeg`): with an uncorrected
  JPEG the grey and the colour fit keep the curve fitted without the
  profile, and with a fully corrected JPEG the whole correction applies.
  Without the change it fails: the curve at 0.25 is 0.460 instead of the
  camera's 0.528. Plus `camera_vignetting_amount_measures_the_share_the_jpeg_shows`
  (0, 40 and 100 % measured within 5 %).
- [x] User-visible change: `lightcraft-cli snapshot` of the loupe and
  `lightcraft-cli render`, with `LIGHTCRAFT_LENSFUN_DIR` set to the
  downloaded database and to an empty folder; `LIGHTCRAFT_PROFILE=1` prints
  the measured share.

Against the camera JPEG, with the downloaded lensfun database: the look
fit's held-out RMS, and the mean CIEDE2000 of the central half of the
render (profile distortion off so the two line up):

| Photo | share | RMS main → this | ΔE00 main → this |
|---|---|---|---|
| #3941: ILCE-7M3, FE 28mm F2, f/2 | 0 % | 0.0625 → 0.0268 | 7.47 → 5.11 |
| corpus: ILCE-9M2 | 0 % | 0.0452 → 0.0149 | 6.84 → 3.39 |
| corpus: ILCE-7RM2 | 45 % | 0.0561 → 0.0556 | 9.14 → 8.96 |
| corpus: SLT-A33 | 0 % | 0.0614 → 0.0341 | 4.70 → 4.82 |
| corpus: ILCE-7SM2 | 0 % | 0.0483 → 0.0449 | 5.29 → 5.28 |
| corpus: ZV-E10M2 | 0 % | 0.0413 → 0.0230 | 7.24 → 5.45 |
| corpus: DSC-RX1RM3 | 0 % | 0.0480 → 0.0396 | 3.91 → 2.90 |
| corpus: ILCE-6400 | 10 % | 0.0350 → 0.0322 | 3.38 → 2.80 |
| corpus: E-M5 Mark II | 30 % | 0.0185 → 0.0178 | 1.76 → 1.74 |
| corpus: PEN-F | 10 % | 0.0218 → 0.0219 | 1.69 → 1.66 |
| corpus: D780 | 35 % | 0.0287 → 0.0188 | 2.93 → 2.57 |

The corpus rows are the CC0 raw.pixls.us files `cargo xtask corpus
--download` pins: of 91 checked (all 37 ARWs, 19 ORFs, 15 PEFs, the first
20 NEFs), these 10 get a lens database vignetting profile into their fit;
the other 81 take the same code path as before. Corpus mean ΔE00 4.69 →
3.96: 6 better, 3 within 0.05, one 0.12 worse; held-out RMS lower on 9 of
10 (PEN-F +0.0001). Script: render each file with both builds under
`LIGHTCRAFT_PROFILE=1` (`--set optics.profileDistortion=0`), read the
measured share and the accepted fit's held-out RMS from stderr, and compare
the central half with the largest embedded JPEG.

## Merging

- **Overlap:** none found fixing #3941. Open pull requests that also touch
  `camera_preview` and bump the shared numbers: #3587 and #2092 (also
  `look_fit.rs`, other functions), #3902, #3635, #2188, #2854.
- **Existing edits and libraries:** photos with a lens database vignetting
  profile get a new camera look (LOOK_VERSION 14) and render closer to their
  camera JPEG; edits and settings are unchanged. A bug fix in the camera
  colour a file gets, which changes the source, not how settings are
  interpreted (docs/process-versions.md), as 001a58e9 landed.
- **Shared numbers taken:** LOOK_VERSION 14, RENDER_CACHE_VERSION 77.
- **Where it came from:** own measurements on the #3941 photo and the CC0
  raw.pixls.us corpus (`cargo xtask corpus`); no lens or camera data added.
- **New dependencies, `unsafe`, build scripts, network access, spawned
  processes, deleted files, CI or `xtask` gate changes:** none.
2026-11-11 12:55:52 +01:00
r3d42-gitandCodex bd3ee7ea8d LR-PROF-CAMERACOLOR: narrow standalone color geometry scope
Merge current upstream main without rewriting the published branch. Keep
non-CR3 geometry and fixed-lens resolution, required pooled/DNG consistency and the
loaded-LensDB/Smart-preview producer provenance as an independent proposal.
The other feature PR is not a prerequisite or merge parent.

Restore current main for general UI/task runtime code, GPU equivalence tests
and Cull benchmark whitespace. Preserve geometry and source-identity gates.
Two bounded CI fixtures remain: stale V1/V2 golden constants aligned to exact
unmodified-main output, and decoded-source isolation before a Find Similar
retry. Main independently reproduced both failures. Assertions, signature
caches, expected counts, production UI and renderer remain unchanged.
Adapt the shared test-directory helper to main's new no-panic lint contract.

Final cargo xtask ci passes all nine gates with Rust1.95.0, actual Metal and
WebAssembly. Tested, staged and committed trees match. Capability skips are
recorded separately. No current real-photo acceptance or product install.

Co-authored-by: Codex <[email protected]>
2026-11-06 08:03:40 +01:00
r3d42-gitandCodex fbc601a756 LR-PROF-CAMERACOLOR: reconcile DCP and display rendering integration
Merge upstream main 89725652 without rewriting published history.
Retain imported camera-profile loader contracts and fresh-original smart
preview provenance, including the existing offline-original guard.
Reconcile independently assigned render75 as combined render76/look14.

Preserve upstream history and external-profile proposal scope. Adapt
upstream GPU and pipeline fixtures to bounded output dithering without
changing rendering code or weakening colour/equivalence bounds. Confirm
new V1/V2 golden hashes independently on exact main; the old quantizer
reproduces the historical hashes. Isolate resumed Find Similar signature
reuse from incidental UI decoded-source caches.

Full macOS CI passes all eight gates with Rust 1.95.0, Metal and WASM.

Co-authored-by: Codex <[email protected]>
2026-11-05 08:14:29 +01:00
robmdunn 51fedfc0f1 Merge raw-negative-channels (with main) into camera-colour-pushed-shadows 2026-11-04 22:50:39 -05:00
r3d42-gitandCodex 1fc885f51e LR-PROF-CAMERACOLOR: reconcile runtime lens database integration
Merge upstream main ae7ac42a without rewriting published history.
Preserve upstream lens download/refresh, optional crop and mask geometry.
Resolve lens documentation limits without dropping the feature scope.

Follow loaded Arc snapshots in lens/camera cache identities; hash optional
crop values without assuming full frame. Build smart previews from fresh
originals with captured database provenance, reject reloads during decoding,
and never mark a replacement database checked by an earlier scan.
Cover reload/replacement, stale/damaged/missing proxies and cached-source
bypass in isolated synthetic regressions. Make the older offline fixture
loader reject a missing original, matching the production loader. Advance combined render cache
to 75 against upstream 74; camera-look version remains 14.

Co-authored-by: Codex <[email protected]>
2026-11-04 19:37:37 +01:00
r3d42-gitandCodex 20b954f3eb LR-PROF-CAMERACOLOR: reconcile current upstream integration
Merge upstream main b4757824b without rewriting the published PR history.
Resolve docs/gaps.md by retaining upstream documentation and the bounded
external-profile geometry proposal. Preserve automatic upstream code changes.

Advance the combined render cache version to 74 because both branches had
independently used 73; camera-look version remains 14. Update its documentation.

Co-authored-by: Codex <[email protected]>
2026-11-04 13:02:41 +01:00
06c1b9ae07 Use crw craftlib (#3503)
* CRW-LIB: decode Canon CRW through the shared craft-crw crate

LightCraft decodes Canon CRW (the CIFF raws of the EOS D30, D60, 10D, 300D and the
PowerShot G1/G6) through craft-libs' `craft-crw`, the clean-room decoder derived and
verified on the `clean-room-crw-format-decode` branch and moved there with its frozen
tables and derivation record. `crates/raw/src/vendor/crw.rs` is now the adapter: it maps
the crate's header and samples onto `RawImage` (CFA, levels, active area, orientation,
as-shot white balance, the make/model/time records a CRW keeps instead of Exif) and
converts the capture time through chrono. The dependency is a local path
(`../craft-libs/crates/crw`) until the craft-libs branch merges; then it becomes a git
revision.

Everything LightCraft-side from that branch comes along unchanged: `probe_bytes` fills
metadata gaps from the decoder's records so CRW imports name their camera; the EOS D60
bundled camera profile and its chart-measured dual-illuminant matrices (`chart_table.rs`,
`spectral::Camera` carries its illuminant pair) give the D60 a Kelvin white-balance scale;
CRW joins the JPEG-fitted starting look, the catalog's raw formats and `lightcraft-cli
calibrate`; `RENDER_CACHE_VERSION` 71; the CC0 CRW corpus entries for `cargo xtask corpus`;
coverage, parity, gaps, raw-parity, target-app-parity and ROADMAP updates. The G5 stays
preview-only (the crate refuses it with the reason) and the robustness test keeps its CRW
sample.

What does not come along: the decoder, its tables and `crw_oracle.rs` (now craft-crw's
digest-pinned sample test) and the derivation record, which lives in craft-libs
`crates/crw/clean-room/`. `clean-room/crw/` here keeps only the EOS D60 chart-calibration
document and its capture list, with a README pointing at the record.

Gates: fmt, clippy -D warnings (raw all targets; engine, catalog, cli), lightcraft-raw tests
(475 + 134, the corpus files decoding through the adapter), catalog tests, engine lib tests
(1,300 pass; the two failures, `tests_import::recursive_discovery_…` and
`originals::tests::write_targets_pin_absent_paths_…`, are in files unchanged from main),
`cargo xtask parity`, `assets`, `layers`, `coverage.py --check`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* no message

* no message

* Update documentation after moving code to craft-libs

* Review coment fixes

* CRW: pin craft-crw f3b62ec, a truncated entropy stream is Corrupt

craft-libs #472 makes craft_crw::decode refuse a stream that ends more than
Limits::max_stream_end_fill (64 samples, one block) before the frame does,
instead of filling the rest with predictor values and returning success.
The adapter already maps craft_crw::Error::Corrupt to RawError::Corrupt;
a regression test proves a truncated CRW now fails at this boundary (it
decoded as a flat frame on the old pin) while its header still reads.

Only craft-crw moves; craft-ui/docpath/update/window stay on c5a1cbf.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Code review comment fix

* Add some tests

---------

Co-authored-by: Robert Woldberg <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-11-02 20:41:34 -05:00
r3d42-gitandCodex 04f8c67ca5 LR-PROF-CAMERACOLOR: preserve lens dependencies in colour fits
Resolve file corrections before DNG and merge colour fitting removes lens opcodes. Include the loaded lens database identity in camera render keys and smart-preview staleness/scan markers. Cover real lookup wiring, file-warp precedence, cache transitions, finite support and clipped masks; retain geometry gates and newer/offline proxy handling.

Validated with focused regressions and full cargo xtask ci (8/8, Rust 1.95.0, Apple M5 Max Metal and WASM). DNG/merge regressions fail against the previous ordering. Synthetic headless demo smoke passed; historical photo comparisons were not rerun.

Co-authored-by: Codex <[email protected]>
2026-11-02 10:14:50 +01:00
r3d42-gitandCodex 1424afa3a7 LR-PROF-CAMERACOLOR: reject gains from dropped correspondence edges
Compare original and profile proposal on shared valid edges during search and held-out validation. Keep thresholds, bounded search and existing CR3 framing behavior.

Co-authored-by: Codex <[email protected]>
2026-11-01 19:36:35 +01:00
r3d42-gitandCodex 3f969c2eed LR-PROF-CAMERACOLOR: synchronize external geometry with main
Merge upstream main at 496524ced5 without rewriting published history. Preserve current upstream fixes and retain only the independent feature change in the resulting PR diff.

Co-authored-by: Codex <[email protected]>
2026-11-01 19:15:42 +01:00
robmdunn f381a79067 Merge raw-negative-channels (with main) into camera-colour-pushed-shadows
main took LOOK_VERSION 13, so this branch's 13-16 become 14-17.
2026-10-31 09:28:00 -04:00
aiongg e05c4f7e7c Merge track r3-t08
# Conflicts:
#	crates/meta/README.md
#	crates/ui-egui/locales/cs.json
#	crates/ui-egui/locales/de.json
#	crates/ui-egui/locales/es.json
#	crates/ui-egui/locales/fi.json
#	crates/ui-egui/locales/fr.json
#	crates/ui-egui/locales/id-formats.json
#	crates/ui-egui/locales/id.json
#	crates/ui-egui/locales/it.json
#	crates/ui-egui/locales/ja.json
#	crates/ui-egui/locales/ka-formats.json
#	crates/ui-egui/locales/ka.json
#	crates/ui-egui/locales/pl.json
#	crates/ui-egui/locales/pt-br.json
#	crates/ui-egui/locales/ru.json
#	crates/ui-egui/locales/sv-formats.json
#	crates/ui-egui/locales/sv.json
#	crates/ui-egui/locales/uk.json
#	crates/ui-egui/locales/vi.json
#	crates/ui-egui/locales/zh-hans.json
#	crates/ui-egui/locales/zh-hant.json
#	crates/ui-egui/src/panels/grid.rs
#	crates/ui-egui/tests/it/main.rs
#	docs/gaps.md
#	docs/library-shortcuts.md
#	docs/parity-checklist.md
#	docs/raw-parity.md
#	docs/user/guides/export-photos.md
#	docs/whats-new.md
2026-10-31 02:31:16 +00:00
aiongg 35d2fc957b Merge PR #3402: RAW.colour: fit the per-file look on the vignetting-corrected sensor
Conflicts: crates/engine/src/camera_preview.rs: LOOK_VERSION stays 13, all three version notes kept; docs/raw-parity.md header merged (newer date, both changes)
2026-10-31 02:10:02 +00:00
aiongg 847fc7558d Merge PR #3027: LR-PROF-CAMERACOLOR: docs count 9 bundled camera profiles, not 5 2026-10-31 02:09:51 +00:00
Christian BramandClaude Opus 5.5 cabc9a3d21 RAW.colour: vignetting at the warp's source position; alignment skips missing pixels
Review follow-up to the vignetting fit fix:
- `proxies` applies the embedded vignetting gain before it moves the sensor
  into the camera JPEG's lens geometry, so a warped proxy pixel gets the gain
  of the position it samples, as the render applies it.
- `alignment` reads NaN pixels (outside a lens-warped proxy) as missing. The
  `max(1e-4)` turned them into black, a false edge along the border, and the
  warped candidate lost on wide-angle RAFs with barrel distortion.
- Tests: the colour fit gets the embedded lens, the vignetting is applied
  before the warp, and alignment ignores missing pixels.

27 + 60 X-S10 RAFs: mean ΔE00 unchanged (3.06, 2.55 -> 2.54), none worse by
more than 0.02.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:39:31 +01:00
Christian BramandClaude Opus 5.5 001a58e992 RAW.colour: fit the per-file look on the vignetting-corrected sensor
The RAF look fit compared the uncorrected sensor proxy with the camera
JPEG, which is already corrected for vignetting, so the tone curve learned
the brightening and the render then applied the embedded vignetting
correction a second time. Shadows and midtones came out up to 0.6 / 0.3 EV
too light on X-S10 files.

`look_proxies` applies the embedded correction to the sensor proxy of
every per-file fit (colour, monochrome, near-black fallback), as
`fit_dng_tone` already did. LOOK_VERSION 13, RENDER_CACHE_VERSION 71.

60 held-out X-S10 RAFs: mean ΔE00 2.71 -> 2.55, 32 better, none worse by
more than 0.05.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:00:02 +01:00
samueliliandAntigravity 8ffe73cc3c fix raw lens and vignette corrections
- X-S20 lens distortion and vignetting scale fixes
- X-S20 / X-S10 / X-M5 spectral sensor mappings
- Add Samuel Li to contributors/people.toml

Co-Authored-By: Antigravity <[email protected]>

- address review concerns

- update RENDER_CACHE_VERSION value in docs/camera-preview-colour.md

- made sure diagonal scales are exact match
2026-10-30 08:40:55 -07:00
radialmonsterandClaude Sonnet 5.5 b881b20b72 Kelvin for Fujifilm X-Trans III bodies from the RAF's own neutral pair (#730)
X-T20, X-T2, X-Pro2, X-E3, X-H1 and X100F have no measured colour matrix, so
As Shot showed on the relative scale. Their RAFs store the camera's own
neutral multipliers for Illuminant A and D65 (tag 0xf00c). Two points
give a line in (ln R/G, ln B/G); mired is linear along it, isotherms are
perpendicular, tint is scaled by the CIE locus spacing. Only the file's pair
and CIE colorimetry are used. Bodies with matrices are unchanged. The look
stays the per-file JPEG fit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014ti8KemZbjE2ZgHgV1q1BM
2026-10-28 13:50:56 -04:00
r3d42-gitandOpenAI Codex 46e809f796 LR-PROF-CAMERACOLOR: merge current main and preserve geometry alignment
Retain upstream module extractions and move calibration changes into their current owners. Advance render cache 70 to 71 and include the same explicit CI prerequisite as PR3136.

Co-authored-by: OpenAI Codex <[email protected]>
2026-10-28 07:34:57 +01:00
Brain Wang 88960dbb0e LR-PROF-CAMERACOLOR: docs count 9 bundled camera profiles, not 5 2026-10-26 10:33:56 +08:00
r3d42-git fade8e7d4b LR-PROF-CAMERACOLOR: align lens-corrected camera JPEG training pairs
Use resolved lens geometry and independently gated framing alignment for RAW/camera-JPEG calibration pairs, including pooled calibration and DNG color tags. Resolve unnamed fixed-lens profiles only through a unique exact fixed mount. Invalidate cached looks and previews.

Add synthetic geometry, mask, orientation and fixed-mount regressions. Validate actual RAW renders against the previously tested fix, and run all eight cargo xtask ci gates on the separate Clippy prerequisite.
2026-10-23 10:51:51 +02:00
robmdunn 2deab608cf LR-PROF-CAMERACOLOR: camera-preview doc cites with_pooled_tone's renumbered LOOK_VERSION 2026-10-22 20:54:06 -04:00
robmdunn 2630748a3c LR-PROF-CAMERACOLOR: camera-preview doc cites the renumbered LOOK_VERSIONs and the sensor-channel floor 2026-10-22 20:53:07 -04:00
robmdunn 1c4dea31f5 Merge main into camera-colour-pushed-shadows
# Conflicts:
#	crates/engine/src/camera_preview.rs
#	crates/engine/src/media.rs
#	docs/camera-preview-colour.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-22 19:56:57 -04:00
aiongg fa6f5b285b Integration: one LOOK_VERSION (12) and RENDER_CACHE_VERSION (69) bump for the merged camera-look changes 2026-10-22 02:42:38 +00:00
aiongg 70e9338085 Merge PR #1040: LR-IMP-FORMATS: decode Minolta MRW
docs/parity-checklist.md: header keeps the newer date; LR-IMP-FORMATS row keeps both sides' changes.
docs/raw-parity.md: header change note names both sides' changes.
docs/raw/coverage.tsv: merged cleanly; same rows as both sides, no duplicates (regenerated on the combined branch).
2026-10-22 02:42:05 +00:00
aiongg 2959b3a7e8 Merge PR #2009: Kelvin white balance from Canon CR2 ColorData presets (PowerShot G1 X Mark III)
docs/raw-parity.md: header change note and revision rows keep both sides (newest first).
2026-10-22 02:40:28 +00:00
aiongg bb930900af Merge PR #1545: LR-RAW-DNG: preserve lens corrections in the existing DNG tone-fit proxy
crates/engine/src/camera_preview.rs: LOOK_VERSION keeps both history lines and the higher value.
crates/engine/src/media.rs: RENDER_CACHE_VERSION keeps the higher value.
2026-10-22 02:38:07 +00:00
aiongg 8bd9a3af1e Merge PR #1616: LR-PROF-CAMERACOLOR: near-black frames get a tone curve when no colour look fits (#1587)
crates/engine/src/camera_preview.rs: LOOK_VERSION keeps the higher value; fit_tone_only_pairs (from #1616) takes the HighlightCheck of #699 from fit_tone_only_on, and fit_dark_tone passes its frame's (empty, as no JPEG pixel reaches 0.85) check.
crates/engine/src/media.rs: RENDER_CACHE_VERSION keeps the higher value.
docs/parity-checklist.md: LR-PROF-CAMERACOLOR row keeps both sides' changes.
2026-10-22 02:37:46 +00:00
aiongg cf804ee9f6 Merge PR #699: LR-PROF-CAMERACOLOR: fit the tone curve of low-contrast scenes (range limit 1.5 to 1.2)
crates/engine/src/camera_preview.rs: LOOK_VERSION keeps both history lines and the higher value.
crates/engine/src/media.rs: RENDER_CACHE_VERSION keeps the higher value.
2026-10-22 02:37:09 +00:00
robmdunn 708ee202b4 Merge main into camera-colour-pushed-shadows
Main's DNG tone fit took LOOK_VERSION 10; this branch's look versions move to 11-14.
2026-10-21 20:51:05 -04:00
robmdunnandClaude ef3d7bc67f LR-PROF-CAMERACOLOR: document the pooled curve continuing a tone-only fit
Co-Authored-By: Claude <[email protected]>
2026-10-19 19:41:32 -04:00
Andrew FrahnandClaude Sonnet 5.5 5e1bac1264 Merge upstream/main into pr/longtail-raws
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 09:58:17 +11:00
Andrew FrahnandClaude Sonnet 5.5 b2a58e8f33 Merge upstream/main into canon-colordata-kelvin
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 09:19:53 +11:00
robmdunn 542bb59fbf LR-PROF-CAMERACOLOR: continuing a photo's curve keeps it where its JPEG taught it
To make room for the pooled extension in the curve's 32 knots, extend_tone kept every
n-th knot of the photo's own curve, which could move the curve inside the range its JPEG
showed (a sharp toe most). It now drops the knots the curve needs least, one at a time,
within one 8-bit code (thinned_knots); with fewer extension knots if needed, or the
photo's curve as fitted when even two don't fit. On a D750 bracket renders move by at
most dE 0.09. LOOK_VERSION 13. Found by CodeRabbit on #2093.
2026-10-18 19:01:56 -04:00
robmdunn 174c56c977 LR-PROF-CAMERACOLOR: photos too dark for colour pairs still give the pooled curve their shadows
profile_samples returned nothing when collect_pairs found no colour pairs, so the darkest
photos, the ones that show the camera's toe, never reached the pooled tone curve. Their
tone samples are now kept; Pool counts them apart from the colour fit's photos and
calibrate reports them as tone only. A black-and-white camera JPEG (a monochrome picture
style's own mix and curve) gives nothing, as before. Found by CodeRabbit on #2093.
2026-10-18 19:01:56 -04:00
robmdunn 27d65b252b LR-PROF-CAMERACOLOR: only a look with the profile's colour takes its pooled tone curve
The pooled curve maps luminance through the profile's matrix. A photo whose own fit
rejected the profile's colour renders through its own matrix, so continuing its curve
along the pooled one gave it a highlight mapping fitted to other colours. Such a look now
keeps its curve as fitted (with_pooled_tone). LOOK_VERSION 12. Found by CodeRabbit on #2093.
2026-10-18 19:01:55 -04:00
robmdunn d54ea1fa24 LR-PROF-CAMERACOLOR: camera profiles carry a pooled tone curve
lightcraft-cli calibrate also pools tone samples (camera RGB -> camera JPEG
luminance, dark pixels included) and fits one curve per camera by quantile
matching; profiles store it as an optional `tone` field (older profiles and
builds still load). A photo keeps its own curve as far as its JPEG showed it and
follows the pooled curve past that, faded over 1 EV (extend_tone), instead of
the bounded shoulder that rendered underexposed photos pushed back up 4-7 L*
too dark; a photo no look fits takes the pooled curve whole.

On NIKON D780 brackets, pushed frames now match the properly exposed frame
within 0.5 L*; on 120 held-out D780/D750/D90 photos rendered as shot the curve
changes mean dE against the camera JPEG by at most 0.03.

LOOK_VERSION 11.
2026-10-18 19:01:55 -04:00