Skip to content

bokehBlur ​

Throws the picture out of focus as a lens does, its highlights blooming into discs.

tsx
import { Clip, Composition, Track } from "@uberscene/kit";

// bokehBlur: Throws the picture out of focus as a lens does, its highlights blooming into discs.
export default function Video() {
  return (
    <Composition fps={30} width={640} height={360}>
      <Track id="main">
        <Clip
          id="shot"
          src="asset:espresso"
          in={2}
          out={5}
          fit="cover"
          effects={[
            {
              type: "bokehBlur",
              highlights: 0.8,
              radius: [
                { at: 0.5, value: 0, easing: "easeInOut" },
                { at: 1.5, value: 16 },
              ],
            },
          ]}
        />
      </Track>
    </Composition>
  );
}

The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.

Params ​

Drawn as a shader.

paramtypedefaultdescription
radiusnumber (0..200)12How far each point spreads: the radius of the lens's disc, in pixels.
highlightsnumber (0..1)0.5How much the bright parts bloom into discs: 0 weighs every point alike, 1 the most.

All effects and transitions · Units

MIT licensed.