packages/docs/docs/light-leaks-guide.mdx
The <LightLeak> component from @remotion/light-leaks renders a WebGL-based light leak effect. The effect reveals during the first half of its duration and retracts during the second half.
import {LightLeak} from '@remotion/light-leaks';
import {AbsoluteFill} from 'remotion';
const MyComp = () => {
return (
<AbsoluteFill style={{backgroundColor: 'black'}}>
<LightLeak durationInFrames={60} seed={3} hueShift={30} />
</AbsoluteFill>
);
};
The seed prop controls the shape of the light leak pattern. Different values produce different patterns.
import {LightLeak} from '@remotion/light-leaks';
import {AbsoluteFill} from 'remotion';
// ---cut---
const MyComp = () => {
return (
<AbsoluteFill style={{backgroundColor: 'black'}}>
<LightLeak seed={5} durationInFrames={30} />
</AbsoluteFill>
);
};
Use hueShift to rotate the color of the light leak in degrees (0–360):
0 (default) — yellow-to-orange120 — shifts toward green240 — shifts toward blueimport {LightLeak} from '@remotion/light-leaks';
import {AbsoluteFill} from 'remotion';
// ---cut---
const MyComp = () => {
return (
<AbsoluteFill style={{backgroundColor: 'black'}}>
<LightLeak hueShift={240} durationInFrames={30} />
</AbsoluteFill>
);
};
Combined with <TransitionSeries.Overlay>, you can place a light leak at the cut point between two sequences without shortening the timeline.
import {AbsoluteFill} from 'remotion';
const Fill = ({color}: {color: string}) => <AbsoluteFill style={{backgroundColor: color}} />;
// ---cut---
import {LightLeak} from '@remotion/light-leaks';
import {TransitionSeries} from '@remotion/transitions';
const LightLeakTransition = () => {
return (
<TransitionSeries>
<TransitionSeries.Sequence durationInFrames={60}>
<Fill color="#0b84f3" />
</TransitionSeries.Sequence>
<TransitionSeries.Overlay durationInFrames={20}>
<LightLeak />
</TransitionSeries.Overlay>
<TransitionSeries.Sequence durationInFrames={60}>
<Fill color="pink" />
</TransitionSeries.Sequence>
</TransitionSeries>
);
};
At the midpoint, the light leak covers most of the canvas, hiding the cut between scenes.