regionBlur
Blurs a box of the frame, to hide a face, a person, a plate or a screen.
tsx
import { Clip, Composition, Effect, Keyframe, Track } from "@cutcraft/kit";
// regionBlur: Blurs a box of the frame, to hide a face, a person, a plate or a screen.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip id="shot" src="asset:coffeeWide" in={4} out={7} fit="cover">
<Effect id="look" type="regionBlur" params={{ box: [0.66, 0, 0.34, 1], roundness: 0.3, feather: 16 }}>
<Keyframe id="k1" param="radius" at={0.5} value={0} />
<Keyframe id="k2" param="radius" at={1.5} value={18} 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.
| param | type | default | description |
|---|---|---|---|
box | [number, number, number (> 0), number (> 0)] | [0.25,0.25,0.5,0.5] | The box to blur, as [x, y, width, height] fractions of the frame from the top left. |
radius | number (0..200) | 7 | How strong the blur is, in pixels: the Gaussian's standard deviation. |
feather | number (0..500) | 10 | How far in from the box's edge the blur fades in, in pixels. |
roundness | number (0..1) | 0 | How round the box's corners are: 0 is square, 1 rounds the short side fully. |
inverted | boolean | false | Blur everything outside the box instead of inside it. |