mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-27 11:37:13 -06:00
The proxy's largest visible error against the original was the JPEG encoder's quantised 8x8 DCT DC - each block's own mean, luma and chroma - which shows as block steps across the frame and a small constant colour shift, and grows with saturation. Quality 92 -> 97 shrinks those quantisers to about a third (block -mean dE76 0.138 vs 0.202 on the fidelity test's smooth scene), at about twice the file size; what remains is the 8-bit sRGB quantisation both encoders share, which only a lossless proxy format can close. The header gains an `enc` field (encode version 2) and the folder's look marker becomes "<look> <enc>": a proxy or marker from before the encode version is rebuilt/rescanned once, so existing libraries pick the new quality up without any command. Old files still decode bit-identically (the scale mapping is untouched, decode ignores `enc`), and a new proxy read by an older build is left alone by its staleness check. The fidelity test pins the gain with a frozen copy of the old encoder and a block-mean dE76 metric (per-pixel dE is dominated by the shared 8-bit floor); the 0.8 bound is the geometric midpoint between the no-op ratio 1.000 and the 0.632 floor cap the 8-bit quantisation sets on this scene.