Skip to main content

ImageOverlayImage

ClassDataClassSource

ImageOverlayImage(
image: Image,
size: tuple[int | None, int | None] | None = None,
feather_depth: int = 0,
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 linear gradient.

Fields​

NameTypeRequired
Description
imageImageThe image filled as the overlaying layer.
sizetuple[int | None, int | None] | None

The size of the image. If not specified, will use the layer size.

If at least one of the size is not specified, will attempt to resize the image while preserving the ratio.

feather_depthintWhether to apply feathering edge mask to the image. If this value is 0, will use the image as it is.
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.