mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-11 16:38:24 -06:00
NEF carries no colour description, so D4 frames developed with the camera channels taken as sRGB primaries and no tone curve (dark, pale), the sensor's optical-black columns showed as a purple stripe on the right, and clipped highlights turned pink (green saturates first). crates/raw/src/cameras.rs holds camera profiles measured from the cameras' own output (no third-party tables), applied to TIFF/EP raws by make, model and sensor size. Sensor gains tone_curve (like DNG ProfileToneCurve, per channel in linear ProPhoto), folded into the gamma LUT; other cameras develop exactly as before. Nikon D4, from 148 uncompressed NEFs of one body (ISO 100–10000): - image area 4928x3280 at (8, 6): where the camera's own full-size JPEG sits, found by aligning the two (2 columns of optical black on the left, 50 + 8 on the right); - black 0 (the data is black-subtracted in camera: the darkest image pixels reach 0); - white 15520: green saturates at 15546–15672, red and blue at 15687–16383, so one level just below green makes clipped highlights white without moving the white balance; - ForwardMatrix (white-balanced camera → XYZ D50) and tone curve fitted to the embedded JPEGs (Picture Control Standard, Active D-Lighting off; 52 frames, smooth areas). On 15 held-out frames PhotoCraft's development is 7.0/255 per channel from the camera's JPEG on average, against 34 before. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>