photocraft/crates/gpu
Brandon Thomas 4759d12b57 Modern Brightness/Contrast: real Photoshop curves (CPU + GPU)
The non-legacy B/C was a linear scale that hard-clipped; Photoshop's modern
B/C is a pair of smooth curves that pin pure black and white. Reverse-
engineered from Photoshop 2026 ground truth (a 0..255 ramp pushed through the
app via executeAction BrgC, useLegacy=false):
  - Contrast: symmetric cubic-Hermite S pivoting at 0.5 (end slope 1-c/128,
    centre 1+c/128) -- near-exact, <=0.5/255 vs Photoshop.
  - Brightness: line of slope 1.375^(b/50) rolled off to (1,1) by a v^P white
    anchor -- close, approximate at the extremes (the real roll-off is a spline).
Applied brightness-then-contrast; matched in the wgsl compositor (mbright/
mcontrast) so GPU == CPU oracle (gpu parity 18/18). Golden tests pin both
curves to the captured Photoshop samples.

Corpus oracle: brightnesscontrast_grayscale.psd max error 0.478 -> 0.086
(bad px 91% -> 29%); 113 pass / 30 differ unchanged (no regressions).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-03 09:11:44 -04:00
..
src Modern Brightness/Contrast: real Photoshop curves (CPU + GPU) 2026-10-03 09:11:44 -04:00
tests Fidelity, GPU fallbacks, interactive performance; print spool-file fix 2026-10-02 01:26:34 -04:00
Cargo.toml work in progress 2026-10-01 10:07:04 -04:00