Show camera profiles in every view and remember proof and DCP settings.

A profile chosen for a raw only changed Develop and exports, so the grid,
Compare and preset previews could disagree with the file. They now grade
camera-native samples, while the proof profile persists with a rendering
intent and DCP matrices can be reused per camera body.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-28 04:04:44 +00:00
parent 0c113e7a91
commit 637629385a
16 changed files with 720 additions and 39 deletions
+21 -8
View File
@@ -835,7 +835,10 @@ The browser cannot demosaic camera raw, so the server does it during upload:
texture and applies `rgb_cam` in the grade shader, so the grade has 65,536 levels per
channel instead of 256. A photo without a sidecar — one imported before this existed,
a non-raw file, or a build with `LUMINARY_16BIT=0` — simply grades the JPEG, so
nothing breaks either way.
nothing breaks either way. The grid and Compare read the same samples: on first
request the server writes a camera-native tile the size of the JPEG thumbnail at
`previews/<id>.t16.png`, and Compare loads the full sidecar, so a loaded DCP profile
shows in every view of the photo. Preset previews do the same.
3. If LibRaw cannot open the file, the largest JPEG embedded in the container is
extracted and normalised instead. The grid marks such photos `RAW` and the Info panel
reports which engine produced the proxy, so exotic or very new cameras still import.
@@ -970,7 +973,8 @@ Conventions worth knowing before changing code:
| `src/lib/editSections.test.ts` | Selective settings copy and the ISO-aware auto-noise curve |
| `src/lib/preview16.test.ts` | 16-bit PNG proxy parsing, row flip, half-float encoding and the camera matrix chunk |
| `src/lib/dcp.test.ts` | DCP tag parsing and the camera matrix recipe against LibRaw's own values |
| `src/lib/softProof.test.ts` | ICC parsing (including counted lut16 tables), the printer round trip, gamut threshold and CMYK profiles |
| `src/lib/softProof.test.ts` | ICC parsing (including counted lut16 tables), the printer round trip, gamut threshold, rendering-intent selection and CMYK profiles |
| `src/lib/dcpLibrary.test.ts` | Per-camera DCP library: validation, replacement, forgetting and camera matching |
There are no server integration tests; the API is exercised through the UI.
@@ -1009,9 +1013,11 @@ There are no server integration tests; the API is exercised through the UI.
present, which is what keeps a heavy shadow lift or a 3200 K white balance from
posterising an 8-bit source; the JPEG and everything derived from it (thumbnails,
denoise renders, proofs) stay 8-bit. A per-photo DCP profile is applied wherever
the sidecar is, i.e. the Develop canvas and exports; grid thumbnails and the compare
view grade the sRGB JPEG, which already has the body matrix baked in, so they do not
show a different camera profile. The sidecar costs about 25× the JPEG in disk, one download per photo at open time and
the sidecar is: the Develop canvas, exports, Compare and preset previews. The grid
uses a camera-native tile built on demand beside the sidecar (`previews/<id>.t16.png`),
so a profile does not cost a 50 MB fetch per card; a photo that predates the tile or
was imported with `LUMINARY_16BIT=0` falls back to the JPEG, which already has the
body matrix baked in. The sidecar costs about 25× the JPEG in disk, one download per photo at open time and
one extra texture in GPU memory (about 8 bytes per pixel), so `LUMINARY_16BIT=0` turns
it off for libraries that would rather have the space. Either way the 16-bit TIFF export writes 65,536
samples per channel from the `RGBA16F` render target, so its precision is only more
@@ -1022,15 +1028,22 @@ There are no server integration tests; the API is exercised through the UI.
matrix pair. Raw decode uses the camera's own matrix; a DCP `ColorMatrix` reproduces
it exactly (`src/lib/dcp.ts` parses the file and derives the matrix), and **Develop →
Camera profile** loads a `.dcp` per photo, storing the derived 9-number matrix in
the edit so it follows presets, snapshots and XMP. The picker is available only on
the edit so it follows presets, snapshots and XMP. A loaded matrix is also remembered
per camera body in a local profile library (`src/lib/dcpLibrary.ts`), so the next
frame from that body needs one menu pick instead of another file dialog; the edit
keeps its own copy, so the library is only a shortcut. The picker is available only on
camera-native sidecars; an older sRGB proxy needs a RAW reprocess first.
Auto masks are an on-device colour-model segmentation (border histogram, Otsu split,
connected components), not a trained segmentation network, so a subject that shares
its colour with the background needs a brush pass. Soft
proofing applies a printer profile's real A2B/B2A tables when one is loaded
(**Soft proofing → Load ICC profile**), and falls back to paper white, black point and
a gamut approximation otherwise. The profile is session state rather than part of the
edit, and the print dialog still does its own colour management. Both LUT layouts are
a gamut approximation otherwise. The loaded profile is remembered on this device (a
small IndexedDB store, not the photo record or the catalog) and the edit stores the
rendering intent — perceptual, relative colorimetric or saturation — so a proof
survives reloads and follows the photo. A profile without tables for the chosen intent
falls back to its perceptual pair. The print dialog still does its own colour
management. Both LUT layouts are
read: v2 `lut16` with fixed 256-entry tables and the counted v4 layout that MOAB/Epson
paper profiles and Ghostscript's press profiles actually use (4096 entries, counts at
offsets 48/50). Against LittleCMS on a MOAB/Epson ET-8550 profile the cube agrees to a