Skip to main content

ImageOverlayColor

ClassDataClassSource

ImageOverlayColor(
color: str | tuple[float, ...],
pos_shift: tuple[int, int] = (0, 0),
mode: Literal["default", "add", "add_modulo", "screen", "lighter", "subtract", "subtract_modulo", "multiply", "darker", "difference", "soft_light", "hard_light"] = "default"
)

An overlay layer with a pure color.

Fields​

NameTypeRequired
Description
colorstr | tuple[float, ...]The RGB/RGBA color of the overlaying layer.
pos_shifttuple[int, int]The shift of the overlaying content. By default, the content will be center- aligned with the giving shape. The overlaying content that is outside the shape mask will be cut off.
modeLiteral["default", "add", "add_modulo", "screen", "lighter", "subtract", "subtract_modulo", "multiply", "darker", "difference", "soft_light", "hard_light"]The blender mode of the overlaying effect.

Methods​

overlay​

v_1: Image | None = self.overlay(shape: Image)

Generate the overlay image from the given image.

Requires​

NameTypeRequired
Description
shapeImageAn L type image defining the shape of the overlay. This value is provided when rendering the overlaying effect.

Returns​

NameType
Description
v_1Image | None

The generated overlay image. This image can be not RGBA, but will be automatically converted to RGBA by applying the self.shape as the alpha channel. The size can be different from the input image. However, in most cases, this size should be the same as self.shape.

This image should be center-aligned with the input self.shape.

Will return None if the effect should be skipped.

Properties​

intermediate_bg_color​

intermediate_bg_color: str | tuple[float, ...] = self.intermediate_bg_color

The intermediate background color. This value may be used when the layer content needs to be rescale.