FadeIn and FadeOut.
FadeIn
Gradually increases opacity from 0 to the clip’s original opacity over the specified duration.Constructor
Duration of the fade in seconds, measured from the start of the clip.
Example
How It Works
TheFadeIn effect modifies the clip’s opacity function to create a gradual transition:
- t < duration: Opacity = original_opacity × (t / duration)
- t ≥ duration: Opacity = original_opacity (no change)
src/movielite/vfx/fade.py:4-30
FadeOut
Gradually decreases opacity from the clip’s original opacity to 0 over the specified duration.Constructor
Duration of the fade in seconds, measured from the end of the clip.
Example
How It Works
TheFadeOut effect modifies the clip’s opacity function:
- t ≤ (clip_duration - duration): Opacity = original_opacity (no change)
- t > (clip_duration - duration): Opacity = original_opacity × (1 - fade_progress)
fade_progress = (t - (clip_duration - duration)) / duration
Source: src/movielite/vfx/fade.py:32-59
Combining Fade Effects
You can apply both fade-in and fade-out to the same clip:Make sure the combined duration of fade-in and fade-out doesn’t exceed the clip duration, or they will overlap.
With Other Effects
Fade effects work well with other visual effects:Technical Details
Fade effects modify the clip’s opacity function rather than manipulating pixel values directly. This makes them very efficient and allows them to work seamlessly with other effects.
Implementation Notes
- Fade effects wrap the existing opacity function with a time-based multiplier
- The original opacity is preserved and multiplied by the fade factor
- Linear interpolation is used for smooth transitions
- No pixel-level operations are performed, making fades very fast
See Also
- Blur Effects - Combine with BlurIn/BlurOut for smooth transitions
- Color Effects - Adjust colors during fades
- VideoClip.set_opacity() - Manually control opacity