mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-27 03:27:14 -06:00
The per-photo look fitted its tone curve as the camera JPEG's median per scene-luminance bin followed by isotonic pooling. On lens-corrected, sharpened JPEGs of busy scenes neighbouring bins disagree by more than the gap between them, so pooling produced flat steps: 13 of 31 segments on a CC0 Z 6II sample, flat segments in 9 of 13 fitted Nikon Z / ILCE-7 samples. Each step maps a range of scene tones to one output tone, which renders as posterised patches with hard edges (issue #475, also #211, #454), and the conditional medians flatten both ends of the curve. Quantile matching (sorted scene quantiles against sorted JPEG quantiles) is increasing by construction and insensitive to misregistration. On the same 13 files no fit has a flat segment, all still pass the gates, held-out RMS within 0.005 of before. Regression test: a misregistered synthetic JPEG.