Glitch, ChromaticAberration, and Pixelate.
Glitch
Create digital distortion artifacts simulating VHS glitches, digital corruption, and RGB channel shifts.Constructor
Intensity of the glitch effect, from 0.0 (no effect) to 1.0 (maximum glitch).
Automatically clamped to [0.0, 1.0].
Enable RGB channel shifting. Separates red and blue channels horizontally.
Enable horizontal displacement lines that create scanline-like glitches.
Enable scan line artifacts (alternating dark lines).
Examples
How It Works
RGB Channel Shift
- Shifts red channel right by
2% × intensityof frame width - Shifts blue channel left by the same amount
- Creates chromatic separation effect
Horizontal Displacement Lines
- Generates random horizontal bands
- Number of bands:
5 × intensity - Each band shifts horizontally by random amount
- Shift range:
±10% × intensityof frame width
Scan Lines
- Creates alternating dark lines (every other line)
- Darkness:
15% × intensity - Simulates CRT/VHS scan line artifacts
The glitch effect uses time-based seeding for pseudo-random patterns. This ensures consistency - the same frame at the same time will always have the same glitch pattern.
src/movielite/vfx/glitch.py:6-82
ChromaticAberration
Chromatic aberration effect that separates RGB channels, simulating lens distortion.Constructor
Intensity of the aberration in pixels. How far to shift the RGB channels.
Minimum value is 0 (automatically enforced).
Examples
How It Works
- Shifts red channel right by
intensitypixels - Shifts blue channel left by
intensitypixels - Green channel remains unchanged
- Creates color fringing effect similar to lens distortion
Unlike the
Glitch effect’s RGB shift (which is percentage-based), ChromaticAberration uses absolute pixel values. This makes it more predictable and consistent across different resolutions.src/movielite/vfx/glitch.py:84-120
Pixelate
Pixelate effect that reduces resolution to create a blocky, retro appearance.Constructor
Size of pixelation blocks in pixels. Larger values = more pixelated.
Minimum value is 1 (automatically enforced).
Examples
How It Works
- Downscale: Resize frame to
(width/block_size, height/block_size)using linear interpolation - Upscale: Resize back to original dimensions using nearest-neighbor interpolation
- The nearest-neighbor upscaling creates the blocky effect
The pixelate effect uses OpenCV’s fast resize operations. Even with large block sizes, performance remains excellent.
src/movielite/vfx/glitch.py:122-156
Combining Glitch Effects
Layered Glitch
Retro Digital Look
VHS Tape Distortion
Creative Use Cases
Cyberpunk Aesthetic
Glitch Transition
Censorship/Privacy Effect
Performance Considerations
All glitch effects use NumPy array operations which are highly optimized. However, they do process every frame:
- Pixelate: Very fast (just resize operations)
- ChromaticAberration: Fast (simple channel shifts)
- Glitch: Moderate (multiple operations per frame)
Intensity Impact
| Effect | Low Intensity | High Intensity | Performance Impact |
|---|---|---|---|
| Glitch | 0.0 - 0.3 | 0.7 - 1.0 | Low to Moderate |
| ChromaticAberration | 1 - 5px | 15 - 30px | Very Low |
| Pixelate | 5 - 10 | 30+ | Very Low |
Technical Details
Glitch Random Seed
TheGlitch effect uses time-based seeding:
- Consistent glitches at the same timestamp
- Variation between frames (different t values)
- Reproducible results
Color Channel Order
OpenCV uses BGR color order, so:- Channel 0 = Blue
- Channel 1 = Green
- Channel 2 = Red
See Also
- Blur Effects - Combine with blur for motion effects
- Color Effects - Enhance glitch aesthetic with color grading
- Rotation - Add rotation for dynamic glitches