← back to roto on ba3a.dev

ShadingFit

object ShadingFit

Fits a clip's ClipShading: for each zone, the ShadeSettings percentiles of the OKLab lightness of all its pixels across every frame. Percentiles are nearest-rank on the sorted lightnesses, so the fit is exact and the same on every machine.

Functions

Link copied to clipboard
fun fit(frames: List<Raster>, zones: List<IndexedRaster>, steps: List<Int>, settings: ShadeSettings): ClipShading

The shading of frames, labelled by zone in zones, where zone i + 1 has steps[i] ramp steps. A zone no pixel belongs to gets an empty range, and so its middle step.