Repository navigation
LR-PROF-CAMERACOLOR: a profiled model's partial look takes the profile's colour - #3972
MartenAngner wants to merge 8 commits into
Conversation
A raw without colour matrices whose full JPEG fit fails gets a partial look: tone and chroma curves over the generic camera ≈ sRGB colour. A partial look counts as a fit, so the measured spectral matrices of a covered model were never reached, and these are the scenes (saturated, narrow-band light, many clipped proxy pixels) where the generic colour is furthest from the camera's. When the model has spectral matrices and no camera profile, the partial look now takes their colour (in the sensor proxy's space, white kept white) with its tone and chroma curves fitted on top. On a Canon EOS R50 night shot of an LED-lit wall (EOS R10 matrices), against the camera JPEG: mean CIEDE2000 7.1 -> 4.9, colourfulness 0.75 -> 0.93, median hue error 9.9° -> 1.3°. Of 444 local corpus raws one changes (an X-E4 near-grey frame, 1.3 -> 1.6). LOOK_VERSION 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Docs only: gaps.md header and revision history, the LR-PROF-CAMERACOLOR row, and the What's New entry, which moves under Unreleased. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Docs only: the gaps.md header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e generic partial look When a model had measured matrices, the partial fit tried only that colour. If it missed the gates the photo lost the generic partial look it had before and fell through to the spectral branch's default tone curve. Retry with the generic colour; a measured fit that passes is unchanged. Also test that fit_preview hands the measured colour to the fit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A measured partial look can miss its gates and fall back to the generic one, models with a camera profile skip it, and a photo with no fitted look has no JPEG-matched tone. Accepted partial looks can also change (the X-E4 frame in docs/camera-preview-colour.md), so "unchanged" holds for full matches only.
…ofiles fit_preview looks up the model's camera profile, which a local <config>/camera-profiles/Canon_EOS_R50.json replaces, so the test failed on a machine with one. fit_preview_with takes the profile; the test passes none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e's colour When the full camera-JPEG fit fails, a model with a camera profile now gives its partial look the profile's matrix and hue/saturation table, as storytold#3587 does with the spectral matrices for models without a profile. Before, the profile was dropped together with the full look, so stage and LED photos of profiled models opened in the generic colour. Sony ZV-E10 stage photo vs the camera JPEG: ΔE00 14.15 -> 8.94, colourfulness 0.32 -> 1.02. LOOK_VERSION 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…#3984 #3992 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
This is stacked on #3587, which is still open and conflicts with main. Please wait for it to land or fold the two together, then rebase onto main. Please also remove the "Generated with Claude Code" footer from the PR body and the One question for the rebase: with the profile's matrix on the partial look, |
Part of #1207. Stacked on #3587: this PR's own commit is the last one,
LR-PROF-CAMERACOLOR: a profiled model's partial look takes the profile's colour.Stage photos from a camera with a camera profile opened grey and washed out when the camera-JPEG match failed: the profile was dropped together with the full look. With this PR the partial look takes the profile's colour, matrix and hue/saturation table. On a Sony ZV-E10 stage photo, against the camera JPEG: ΔE00 14.2 → 8.9, colourfulness 0.32 → 1.02. Photos whose full match already works are unchanged.
Problem
A Sony ZV-E10 evening event (purple and blue stage light, LED screens) with a camera profile from
lightcraft-cli calibrate(62 photos of the same evening, throughLIGHTCRAFT_CAMERA_PROFILES). The bar and mingling photos opened close to the camera's JPEG. The stage photos opened grey and flat, the screens and a blue dress nearly colourless.Cause:
fit_previewgives the camera profile's colour to the full search only. On these scenes the full search fails its gates (LIGHTCRAFT_PROFILE=1: held-out RMS 0.2178 → 0.2183, chroma error 302 → 290), andfit_partialthen fits the generic colour (identity or the damped own matrix). #3587 gives the partial look the model's measured spectral colour, but only when there is no camera profile, so a profiled model still falls back to the generic colour: the photos the profile was made for are the ones that lose it.Change
look_fit.rs:fit_preview_withpasses the profile's colour (matrix and table) as the partial look'smeasuredcolour when the model has a profile; without one, the spectral colour as in LR-PROF-CAMERACOLOR: night and LED raws no longer open washed out when the camera-JPEG match fails #3587.pairs.rs:fit_partial'smeasuredisOption<&(Mat3, Option<HsvTable>)>. The table is applied after the matrix in the tone fit, the highlight check and the gate, the same wayfit_pairs_ondoes for a full look, and kept in the look. A measured colour without a table behaves as in LR-PROF-CAMERACOLOR: night and LED raws no longer open washed out when the camera-JPEG match fails #3587.LOOK_VERSION14 → 15 (smart previews refit).camera-preview-colour.md(new paragraph "A partial look in the camera profile's colour", precedence item 2),gaps.mdlog, the LR-PROF-CAMERACOLOR row,whats-new.md.Not in this PR: a profile for bodies that have none (the user makes one with
calibrate); whether a profile should also be tried before a failed partial look in black-and-white photos (unchanged: that path already uses the profile's colour).How it was checked
cargo xtask ci: not the full gate yet. Ran here (Windows, MSVC, rustc 1.99.1):cargo clippy -p lightcraft-engine --all-targets -- -D warningsclean,rustfmt --checkon the changed files, andcargo test -p lightcraft-engine --lib: 1631 passed, 1 failed,tests::library::a_thumbnail_cache_from_before_is_tidied_in_the_background_when_the_library_opens(timing: the activity row was already gone under the full parallel run; it passes 3 of 3 run alone, and touches no camera colour code).fit_preview_gives_a_profiled_models_partial_look_the_profiles_colour(the lens-corrected synthetic scene whose full look fails, with a given profile: the partial look takes the profile's matrix in the proxy space and its table; without a profile it keeps the generic colour). With the one-line change infit_preview_withreverted, it fails at the matrix assertion.lightcraft-cli render(release build of this branch, and the same branch with the change reverted) and compared with the camera JPEG.Against the embedded camera JPEG (mean CIEDE2000 / colourfulness ratio), Sony ZV-E10, profile from
calibrateover 62 photos of the same evening (private photos of an event, not committed):DSC05738stage, LED screenDSC05722room in purple lightDSC05778speaker in a spotlightDSC05682,DSC05700,DSC05743DSC05778gains colour but its ΔE is 0.09 higher.Screenshots
Not attached: the photos show identifiable people at a private event. Happy to share the comparison privately with a maintainer.
Merging
docs/process-versions.mdthat is a source change, not a process change. Smart previews rebuild viaLOOK_VERSION.LOOK_VERSION15 (LR-PROF-CAMERACOLOR: night and LED raws no longer open washed out when the camera-JPEG match fails #3587 takes 14).calibrate); measurements are my own on the files named above. No Adobe profiles used for the numbers.unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Checklist
docs/parity-checklist.mdrow anddocs/gaps.mdupdated in the same commitcargo xtask cihas run and LR-PROF-CAMERACOLOR: night and LED raws no longer open washed out when the camera-JPEG match fails #3587 has landed)🤖 Generated with Claude Code