Vignette effect darkens the edges of the frame, creating a classic cinematic look that draws the viewer’s attention to the center of the image.
Constructor
Darkness intensity at the edges, from 0.0 to 1.0.
0.0= no effect (original frame)1.0= black edges (maximum vignette)- Values between 0 and 1 create varying degrees of darkening
Radius of the bright center area, from 0.0 to 1.0.
0.0= very small bright area (strong vignette)1.0= large bright area (subtle vignette)- Controls how far the bright area extends before darkening begins
Examples
Basic Vignette
Cinematic Look
Extreme Vignette
How It Works
The vignette effect creates a radial gradient that darkens pixels based on their distance from the center:- Calculate distance: For each pixel, compute normalized distance from center
- Create mask: Generate radial gradient based on distance and radius
- Apply intensity: Scale the mask by the intensity parameter
- Multiply: Apply mask to frame to darken edges
Mathematical Formula
(cx, cy)= center of frame(w, h)= frame dimensionsclip()= clamp function
src/movielite/vfx/vignette.py:6-69
Parameter Effects
Intensity Comparison
| Intensity | Visual Effect |
|---|---|
| 0.0 | No vignette (original) |
| 0.2 | Very subtle darkening |
| 0.5 | Moderate vignette (default) |
| 0.8 | Strong darkening |
| 1.0 | Black edges |
Radius Comparison
| Radius | Visual Effect |
|---|---|
| 0.3 | Small bright center (spotlight) |
| 0.5 | Medium bright area |
| 0.8 | Large bright area (default) |
| 1.0 | Very subtle vignette |
Combining with Other Effects
Vintage Film Look
Modern Cinematic
Drama/Horror
Soft Focus Portrait
Performance Considerations
The vignette effect uses mask caching for optimal performance:
- Mask is computed once per frame size
- Cached masks are reused for subsequent frames
- Very fast even at high resolutions
- Negligible performance impact
Caching Behavior
The mask multiplication is the only per-frame operation, which is extremely fast (sub-millisecond for most resolutions).
Advanced Usage
Animated Vignette
While theVignette effect doesn’t support animation directly, you can create custom animated vignettes:
Custom Vignette Shapes
The current implementation creates circular/elliptical vignettes. For custom shapes, you would need to:- Extend the
Vignetteclass - Override the mask generation logic
- Use custom distance calculations (e.g., rectangular, diamond)
Technical Details
Distance Calculation
The effect normalizes distances by dividing by frame dimensions:Mask Generation
The mask is created using NumPy’sogrid for efficient coordinate grid generation:
meshgrid for this use case.
Frame Multiplication
The mask is applied using floating-point multiplication and converted back to uint8:Visual Examples
Intensity Variations (radius=0.7)
Radius Variations (intensity=0.6)
Common Use Cases
- Cinematic Look:
intensity=0.5-0.7, radius=0.7-0.8 - Portrait Focus:
intensity=0.4-0.6, radius=0.8-0.9 - Dramatic Effect:
intensity=0.7-0.9, radius=0.5-0.6 - Subtle Enhancement:
intensity=0.2-0.3, radius=0.9-1.0 - Spotlight Effect:
intensity=0.8-1.0, radius=0.3-0.5
See Also
- Color Effects - Combine with color grading for cinematic looks
- Blur Effects - Add depth of field with blur + vignette
- Fade Effects - Create gradual transitions