roughenEdges()v4.0.487
Part of the @remotion/effects package.
Roughens the alpha boundary of canvas-based components such as <Video>, <HtmlInCanvas>, <CanvasImage> and <Solid>.
Use it on transparent logos, text, masks and cutouts to create an irregular paper-like edge without adding the full paper() texture.
Based on the open-source Paper Shaders noise helpers.
Preview
Example
MyComp.tsximport {roughenEdges } from '@remotion/effects/roughen-edges'; import {CanvasImage ,staticFile } from 'remotion'; export constMyComp :React .FC = () => { return ( <> <CanvasImage src ={staticFile ('logo-with-alpha.png')}width ={1280}height ={720}fit ="contain"effects ={[roughenEdges ({border : 26.5,scale : 0.07,seed : 231.2, }), ]} /> </> ); };
API
Pass an object with the following properties. You can also call roughenEdges() without arguments.
amount?
Strength of the roughened edge from 0 to 1. Defaults to 1.
Use 0 to leave the layer unchanged.
border?
Size of the roughened edge in pixels. Defaults to 26.5.
Higher values allow the edge to move farther inward and outward. Must be between 0 and 200.
scale?
Scale of the generated edge noise. Defaults to 0.07. Must be greater than 0 and at most 4.
Smaller values create finer edge detail. Larger values create broader, wavier edges.
seed?
Seed for the generated edge pattern from 0 to 1000. Defaults to 231.2.
Change it to get a different static edge pattern. To animate the edge, pass a value derived from useCurrentFrame().
disabled?
When true, the effect is skipped. Defaults to false.
Implementations
- WebGL2
- WebGPU (from v4.0.540)
See: Preferred effect backend.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||