Skip to content

bulge ​

Swells the picture around a point, as through a lens, or pinches it inward.

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

// bulge: Swells the picture around a point, as through a lens, or pinches it inward.
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: "bulge",
              radius: 170,
              amount: [
                { at: 0.5, value: 0, easing: "easeInOut" },
                { at: 1.5, value: 0.7 },
              ],
            },
          ]}
        />
      </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
amountnumber (-1..1)0.5How much the centre swells: 1 the most, negative pinches it instead, 0 leaves the picture as it was.
radiusnumber (0..4000)200How far from the centre the bulge reaches, in pixels.
center[number, number][0.5,0.5]The middle of the bulge, as [x, y] fractions of the frame from the top left.

All effects and transitions · Units

MIT licensed.