Skip to content

tiltShift ​

Keeps a band of the picture sharp and blurs the rest, so a scene reads as a miniature.

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

// tiltShift: Keeps a band of the picture sharp and blurs the rest, so a scene reads as a miniature.
export default function Video() {
  return (
    <Composition fps={30} width={640} height={360}>
      <Track id="main">
        <Clip
          id="shot"
          src="asset:redCup"
          in={18}
          out={21}
          fit="cover"
          effects={[
            {
              type: "tiltShift",
              center: [0.5, 0.6],
              width: 50,
              feather: 90,
              radius: [
                { at: 0.5, value: 0, easing: "easeInOut" },
                { at: 1.5, value: 9 },
              ],
            },
          ]}
        />
      </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
center[number, number][0.5,0.5]A point the sharp band runs through, as [x, y] fractions of the frame from the top left.
widthnumber (0..4000)80How wide the sharp band is, in pixels.
feathernumber (0..4000)120How far past the band's edge the blur takes to reach full strength, in pixels.
radiusnumber (0..200)8How strong the blur is away from the band, in pixels: the Gaussian's standard deviation.
anglenumber0How far the band is turned, in degrees clockwise: 0 is level, 90 runs it down the frame.

All effects and transitions · Units

MIT licensed.