Skip to content

Colorlevels

Video Single output Transform

Adjust the color levels.

FFmpeg filter: colorlevels — the official reference.

Add it to a graph. The explicit form works for every filter — bind it to its input and read the result from outputs():

$node = $video->addFilter(new Colorlevels(…));
$result = $node->outputs()[0];

Shorthand. Single-output filters can skip the node — apply() returns the result stream directly:

$result = $video->apply(new Colorlevels(…));

TODO — when this filter shines: what it’s the right tool for, what to reach for instead when it isn’t, and how it composes with neighbouring filters.

TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).

TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.

TODO

TODO

ParameterTypeDefaultRange / valuesDescription
riminfloat0-1–1set input red black point
giminfloat0-1–1set input green black point
biminfloat0-1–1set input blue black point
aiminfloat0-1–1set input alpha black point
rimaxfloat1-1–1set input red white point
gimaxfloat1-1–1set input green white point
bimaxfloat1-1–1set input blue white point
aimaxfloat1-1–1set input alpha white point
rominfloat00–1set output red black point
gominfloat00–1set output green black point
bominfloat00–1set output blue black point
aominfloat00–1set output alpha black point
romaxfloat10–1set output red white point
gomaxfloat10–1set output green white point
bomaxfloat10–1set output blue white point
aomaxfloat10–1set output alpha white point
preserveColorlevelsPreservenonenone, lum, max, avg, sum, nrm, pwrset preserve color mode

Maps to FFmpeg’s colorlevels filter. Verified against ffmpeg n7.1.1.

An Artisan Build project.

Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project. Support FFmpeg.