Highlights
Highlight effects allow you to create highlight effects to elements within the video frames. It is useful when you want to create a highlight effect to an element, or a group of elements or sections of area within the frame.
As of now, the following highlight effects are available:
none: No highlight (default)pulse: Pulsing highlightglow: Glowing highlightbox: Box highlightunderline: Underline highlight
Below is the API documentation for the highlight effects:
audim.sub2pod.effects.highlights
Highlight effects for videos
This module provides highlight effects that can be applied to text or other elements during video generation. Highlights are used to emphasize important parts of the content.
BaseHighlight
Base class for all highlight effects (internal use only)
__init__(color=(255, 255, 0, 128), padding=5)
Initialize the highlight effect
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
tuple
|
RGBA color for the highlight (default: semi-transparent yellow) |
(255, 255, 0, 128)
|
padding
|
int
|
Padding around the highlighted area in pixels |
5
|
apply(frame, area, **kwargs)
Apply the highlight effect to a specific area of a frame
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
The frame to apply the effect to (PIL Image or numpy array) |
required | |
area
|
tuple
|
The area to highlight as (x1, y1, x2, y2) |
required |
**kwargs
|
Additional arguments specific to the highlight |
{}
|
Returns:
| Type | Description |
|---|---|
|
The modified frame with the highlight effect applied |
Highlight
Highlight effects for video elements
This class provides various highlight effects that can be applied to text or other elements during video generation.
Available effects: - "pulse": Pulsing highlight that grows and shrinks - "glow": Glowing highlight with blur effect - "underline": Simple underline highlight - "box": Box around the highlighted area - "none": No highlight effect
__init__(effect_type='none', **kwargs)
Initialize a highlight effect
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
effect_type
|
str
|
Type of highlight effect "pulse": Pulsing highlight "glow": Glowing highlight "underline": Underline highlight "box": Box highlight "none": No highlight (default) |
'none'
|
**kwargs
|
Additional parameters for the specific effect: color (tuple): RGBA color for the highlight padding (int): Padding around the highlighted area min_size (float): For pulse, minimum size factor (e.g., 0.8) max_size (float): For pulse, maximum size factor (e.g., 1.2) blur_radius (int): Blur radius for glow effect thickness (int): Line thickness for underline/box |
{}
|
apply(frame, area, progress=0.0, **kwargs)
Apply the selected highlight effect to a specific area
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
The frame to apply the effect to (PIL Image or numpy array) |
required | |
area
|
tuple
|
Area to highlight as (x1, y1, x2, y2) |
required |
progress
|
float
|
Animation progress from 0.0 to 1.0 |
0.0
|
**kwargs
|
Additional arguments |
{}
|
Returns:
| Type | Description |
|---|---|
|
The modified frame with the highlight effect applied |