Skip to content

Image

ImageInfo

Bases: BaseModel

Represents an image metadata information.

width instance-attribute

The width of the image, in pixels.

height instance-attribute

The height of the image, in pixels.

mode instance-attribute

mode: str

Image mode.

ImageAssetParams

Bases: BaseModel

Represents the parameters for an image assets.

position class-attribute instance-attribute

position: Position = Field(default_factory=AbsolutePosition)

The positioning of the text assets in the video.

z_index class-attribute instance-attribute

z_index: int = -1

The z-index of the assets.

crop class-attribute instance-attribute

crop: tuple[int, int, int, int] | None = None

The crop range for the image assets.

as_background class-attribute instance-attribute

as_background: bool = True

Whether the image should be used as a background.

ImageAsset

Bases: BaseAsset[ImageAssetParams, ImageInfo]

Represents an image assets with various properties.

type class-attribute instance-attribute

type: Literal['image'] = 'image'

The type of the assets. Defaults to "image".

params class-attribute instance-attribute

params: ImageAssetParams = Field(
    default_factory=ImageAssetParams
)

The parameters for the assets.

width property

width: int

The width of the image, in pixels.

Wrapper of ImageAsset.info.width for convenience and type-hint compatibility.

height property

height: int

The height of the image, in pixels.

Wrapper of ImageAsset.info.height for convenience and type-hint compatibility.

mode property

mode: str

Image mode.

Wrapper of ImageAsset.info.mode for convenience and type-hint compatibility.

size property

size: FrameSize

Image dimensions as a tuple.