Skip to content

levels ​

Sets the black point, the white point and the gamma between them.

tsx
import { Clip, Composition, Effect, Keyframe, Track } from "@cutcraft/kit";

// levels: Sets the black point, the white point and the gamma between them.
export default function Video() {
  return (
    <Composition fps={30} width={640} height={360}>
      <Track id="main">
        <Clip id="shot" src="asset:coffee" in={12} out={15} fit="cover">
          <Effect id="look" type="levels">
            <Keyframe id="k1" param="black" at={0.5} value={0} />
            <Keyframe id="k2" param="black" at={1.5} value={0.15} easing="ease-in-out" />
          </Effect>
        </Clip>
      </Track>
    </Composition>
  );
}

The coffee footage is Pixabay videos 209419 and 209424, under the Pixabay Content License.

Params ​

Drawn as a shader, with a CSS filter where WebGL is missing.

paramtypedefaultdescription
blacknumber (0..1)0The input level that becomes black: tones at or below it go to black.
whitenumber (0..1)1The input level that becomes white: tones at or above it go to white.
gammanumber (0.01..10)1The curve on the midtones: above 1 lifts them, below 1 deepens them.

All effects and transitions · Units

MIT licensed.