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-11set input red black point
giminfloat0-11set input green black point
biminfloat0-11set input blue black point
aiminfloat0-11set input alpha black point
rimaxfloat1-11set input red white point
gimaxfloat1-11set input green white point
bimaxfloat1-11set input blue white point
aimaxfloat1-11set input alpha white point
rominfloat001set output red black point
gominfloat001set output green black point
bominfloat001set output blue black point
aominfloat001set output alpha black point
romaxfloat101set output red white point
gomaxfloat101set output green white point
bomaxfloat101set output blue white point
aomaxfloat101set 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.