Skip to content

chromaticAberration ​

Splits red and blue apart, as a cheap lens does.

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

// chromaticAberration: Splits red and blue apart, as a cheap lens does.
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="chromaticAberration">
            <Keyframe id="k1" param="distance" at={0.5} value={0} />
            <Keyframe id="k2" param="distance" at={1.5} value={10} 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.

paramtypedefaultdescription
distancenumber (0..100)4How far red and blue split from green, in pixels; with radial, the split at the corners.
anglenumber90The direction of the split, in degrees clockwise from up: 90 splits sideways. Unused with radial.
radialbooleanfalseSplit outward from center, growing toward the edges as a lens does, instead of along angle.
center[number, number][0.5,0.5]Where a radial split points out from, as [x, y] fractions of the frame from the top left.

All effects and transitions · Units

MIT licensed.