movis.contrib.segmentation.ChromaKey#

class movis.contrib.segmentation.ChromaKey(key_color: tuple[int, int, int] | str = (0, 255, 0), color_space: str = 'hsv', key_color_range: tuple[float, float, float] = (20.0, 0.3, 0.3))[source]#

An effect that extracts the foreground using the chroma key composition.

It extracts the foreground by using the chroma key composition, which identifies the background by a given color. The color is specified by the lower and upper bounds in the HSV color space.

Args:
key_color:

The key color in the RGB color space. It also supports the color name in CSS3 (e.g., blur and green).

color_space:

The color space when extracting the background. Currently, only hsv is supported.

key_color_range:

The color range of the background. The range of each channel is [0, 360], [0, 1], and [0, 1] if the color space is hsv.