Mask

class img_gen.Mask(size: Size | None = None, offset: Offset | None = None, invert: bool = False, background: Background | None = None, ellipse: Ellipse | None = None, rectangle: Rectangle | None = None, polygon: Polygon | None = None, icon: Icon | None = None, typography: Typography | None = None)

An attribute to describe a [Layer]’s [Mask].

as_json_str()

Serialize the Mask object to a JSON string.

as_yaml_str()

Serialize the Mask object to a YAML string.

background

A background attribute for the mask.

ellipse

An ellipse attribute for the mask.

static from_json_str(json_str)

Deserialize a Mask object from a JSON string.

static from_yaml_str(yaml_str)

Deserialize a Mask object from a YAML string.

icon

An icon attribute for the mask.

invert

A flag to control the behavior of the mask.

False means only visible pixels are used in the mask. True means only invisible pixels are used in the mask.

offset

The mask’s [LayerOffset].

polygon

An polygon attribute for the mask.

rectangle

A rectangle attribute for the mask.

size

The mask’s [Size].

typography

A typography attribute for the mask.