Repository navigation
Description
Problem
The white-balance scale is chosen by file extension, not by whether LightCraft knows the camera's colour:
- UI / catalog:
Photo::relative_wb()(crates/catalog/src/model.rs:314) puts every ARW, NEF, NRW, RW2, RWL, RAW, RAF, CR3, CR2, PEF, SRW and ORF on the relative −100…+100 scale. - Render:
crates/engine/src/files.rs:370setsrelative_wbwhen the file has no colour matrices of its own, decided before the spectral lookup, so even raws that fall back to the spectral matrices keep relative WB (adapted generically incrates/pipeline/src/local.rs:35instead of through the camera matrices).
So the 52 models with measured matrices in lightcraft_raw::spectral (e.g. ILCE-7M3, ILCE-7M4, ILCE-7RM3, D850, EOS 5D Mark III) never get a Kelvin readout, unlike Lightroom. For most of their files the matrices are not used at all: the JPEG fit (camera_preview::starting_colour) wins, and the matrices are only the fallback when it fails.
Proposal
When a camera has colour matrices (its own in the file, or a spectral table row), show As Shot and the Temp slider in Kelvin:
- The colour look stays as it is (JPEG fit or bundled per-model profile). The matrices only convert white balance to and from Kelvin: as-shot multipliers → As Shot Kelvin/tint; slider Kelvin/tint → multipliers → the shift applied relative to the as-shot look.
- Raws without matrices keep the relative scale.
- The catalog decision (
Photo::relative_wb) and the render decision (files.rs) must agree.
Must handle
- Existing edits: catalogs and XMP sidecars hold Custom WB on the relative scale (6500 = as shot). Upgrading must not change any photo's look (same class of bug as Lightroom Custom white balance imports as a large blue shift on relative-WB raws (absolute Kelvin read on the relative scale) #510): mark or convert those values.
- XMP interop: Lightroom writes
crs:Temperaturefor these raws as absolute Kelvin, which is currently shifted fromcrs:AsShotTemperature(Lightroom Custom white balance imports as a large blue shift on relative-WB raws (absolute Kelvin read on the relative scale) #510); with an absolute scale this becomes direct. - Presets (Daylight, Cloudy, Shade, Tungsten, Fluorescent, Flash) map to real Kelvin values.
docs/parity.md→ LR-EDIT-COLOR-TEMP is ✅ but its note implies only non-raw files are relative; it should be 🟡 until this lands.
Validation data (ILCE-7M3)
A series shot with WB set to Color Temp./Filter, filter 0 (plus 5500 K G2 / M2), with a grey card in frame, at 1/320 s f/8 ISO 100 under midday daylight with varying cloud. The files are private and kept locally, not in the corpus. As-shot multipliers through the ILCE-7M3 spectral matrices:
| Dial | Reads as | Tint |
|---|---|---|
| 2500 K | 2274 K | −2.1 |
| 3000 K | 2707 K | −4.0 |
| 3500 K | 3157 K | −4.7 |
| 4000 K | 3611 K | −4.7 |
| 4500 K | 4060 K | −4.0 |
| 5000 K | 4524 K | −2.8 |
| 5500 K | 4986 K | −2.4 |
| 6000 K | 5443 K | −1.0 |
| 6500 K | 5898 K | −0.2 |
| 7000 K | 6356 K | +0.7 |
| 7500 K | 6841 K | +2.1 |
| 8000 K | 7323 K | +3.5 |
| 8500 K | 7835 K | +4.9 |
| 9000 K | 8371 K | +6.3 |
| 9500 K | 8907 K | +7.6 |
| 9900 K | 9338 K | +8.9 |
| 5500 K G2 | 4830 K | −36.4 |
| 5500 K M2 | 5017 K | +22.0 |
- Tint stays near the locus across the whole range (the generic model the docs describe read one Sony file as −127), and G2 / M2 move it in the right directions.
- Kelvin reads 7–10 % below the dial, smoothly and monotonically.
- The grey card's raw values read 4830–5045 K, tint about −4, in every frame regardless of the dial (CIE daylight would be about +9.5 tint in LightCraft's units). On Sony's own dial scale the same card reads about 5350–5550 K. Daylight can't tell which is right.
Open: whether the spectral matrices or Sony's dial labels are off. A grey card lit only by an incandescent bulb (blackbody, near Illuminant A where the spectral fit is exact by construction) should decide it. If the matrices read about 10 % low, the dial series doubles as the ILCE-7M3's measured correction curve.
Related: #296 (no Kelvin on an A7 IV ARW, reported together with a separate colour-rendering complaint).
Activity
bitshiftza commentedon Oct 10, 2026
Working on this.
issue storytold#730: Color panel before/after
LR-EDIT-COLOR-TEMP: raw-parity.md describes Kelvin WB for matrix came…
LR-EDIT-COLOR-TEMP: Kelvin white balance for raws whose camera has co…
Nmarello commentedon Oct 12, 2026
A related symptom: when a Lightroom sidecar's Kelvin white balance can't be used, the import says nothing.
A CR2 from a Canon EOS Rebel T5, with a sidecar carrying
crs:WhiteBalance="Custom" crs:Temperature="4200" crs:Tint="+8", imports as As Shot (wb.temp6500, tint 0).library.importreports"sidecars": 1with nowarnings, althoughdocs/xmp-interop.mdsays partly transferablecrs:settings produce per-photo warnings.Everything else in the same sidecar mapped exactly:
Exposure2012,Contrast2012,Highlights2012,Shadows2012,Whites2012,Blacks2012,Clarity2012,Vibrance,Saturationand the crop. Until Kelvin works for these cameras, a warning such as "white balance 4200 K / +8 not applied (this camera uses the relative scale)" would tell users their Lightroom WB didn't come across.LR-MERGE-HDR: real-bracket test report, round 2c (white balance, eefb14c
LR-EDIT-COLOR-TEMP: Kelvin white balance from Sony's white-balance pr…
AlexChambers commentedon Oct 13, 2026
Could you retest Kelvin white balance in LightCraft 0.7.1? PR #752, included through #981, gives calibrated cameras an absolute temperature scale. A public A7 IV sample imports at As Shot 4763 K and tint +13. Cameras without calibration can still use the relative scale. This doesn't establish exact agreement with the camera's Kelvin dial, and the Canon sidecar-warning follow-up remains unresolved.
LR-EDIT-COLOR-TEMP: Kelvin white balance from Sony's white-balance pr…
Nmarello commentedon Oct 15, 2026
Retested on 0.8.0 (the macOS CLI) with the same Canon EOS Rebel T5 CR2s.
Kelvin readout: The T5 (EOS 1200D / Kiss X70) has no row or alias in the spectral table, so as expected it stays on the relative scale. After a decode,
develop.getandphoto.inspectshow As Shot as 6500 / 0. For reference, macOS's raw engine (CIRAWFilter.neutralTemperature) reads these auto-WB shots at about 3400 K.Sidecar warning: This looks fixed. The same sidecar (
crs:WhiteBalance="Custom" crs:Temperature="4200" crs:Tint="+8", with noAsShotTemperature) still imports as As Shot, butlibrary.importnow says so:On 0.6.0 the same file returned
"warnings": null. Everything else in the sidecar still maps exactly.With an as-shot reference: Adding
crs:AsShotTemperature="3400" crs:AsShotTint="+8"to that sidecar gives Custom 10222 K / 0 on the relative scale. That's the expected −56 mired shift for 3400 → 4200 K. The render warms to match, and there are no warnings.From my side the silent drop is resolved; the T5 just doesn't get Kelvin yet. Thanks for following up.
[-]Absolute Kelvin white balance for raws whose camera has colour matrices[/-][+]Kelvin white balance for raws whose camera has no colour matrices[/+]aiongg commentedon Oct 21, 2026
From #2028: Fujifilm RAF (body not named) shows only the −100…+100 scale.
radialmonster commentedon Oct 22, 2026
The X-T20, X-T2, X-Pro2, X-E3, X-H1 and X100F now get an absolute As Shot Kelvin and tint instead of 0 / 0, in PR #2514. It uses the neutral multipliers for Illuminant A and D65 that the RAF itself stores, plus standard colorimetry, so no other camera's data is involved. It is about 7 mired and 3 tint rms off the matrix-based scale in the core range; an X-T20 sample reads 6193 K / +16.
The greens and yellows (default colour) are not changed there. That needs a chart shot from an X-Trans III body: the raw plus the chart, under daylight.
If this solves it, please close the issue, thanks! If not, feel free to reply with more.
Kelvin for Fujifilm X-Trans III bodies from the RAF's own neutral pair (
radialmonster commentedon Oct 22, 2026
PR #2527 (depends on #2514) puts every raw whose file stores neutral multipliers for known lights, and whose camera has no matrices, on the Kelvin scale. Files moved from the relative scale, with As Shot K drawn from the file's own presets:
Panasonic RW2: 7981 files, medians mostly 4300 to 7300 K
Sony ARW: 368 (plus Hasselblad Lunar 1)
Canon CR2: 355, CR3: 111 (As Shot K over the camera's own ColorTempAsShot, median 1.00 and 0.98)
Pentax and Ricoh PEF: 56 (K-5 3830, K-7 4829, K10D 5237, K-1 4200, K-3 III 5270)
Leica RW2: 23
Fujifilm RAF: 15
Per-body counts with median/min/max are in the PR. Still relative, nothing usable in the files: Nikon NEF, Olympus ORF, Samsung SRW, Minolta MRW, Epson ERF, Sony DSC-R1.
Kelvin for Fujifilm X-Trans III bodies from the RAF's own neutral pair (
Kelvin for Fujifilm X-Trans III bodies from the RAF's own neutral pair (
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin for Fujifilm X-Trans III bodies from the RAF's own neutral pair (
Kelvin white balance for more raws whose camera has no colour matrices (
Merge PR #2514: Kelvin for Fujifilm X-Trans III bodies from the RAF's…
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin white balance for more raws whose camera has no colour matrices (
Kelvin white balance for more raws whose camera has no colour matrices (
radialmonster commentedon Dec 4, 2026
@Nmarello Thanks for the retest. The Rebel T5 (EOS 1200D) is covered by #2527, which is still open. It reads As Shot Kelvin from the presets the CR2 itself stores. On that branch, three T5/1200D samples read 4969 K / −7, 5352 K / +4 and 5981 K / +7 instead of 6500 / 0.
If you'd like to follow it, #2527 is the place.
If this solves it, please close the issue, thanks! If not, feel free to reply with more.