Skip to content

Image Helpers

rerun

class ImageChromaDownsampled

Bases: AsComponents

A chroma downsampled image.

The encoded image can be loaded from either a file using its path or provided directly via contents.

def __init__(format, *, path=None, contents=None, draw_order=None)

Create a new image with a given format.

PARAMETER DESCRIPTION
path

A path to a file stored on the local filesystem. Mutually exclusive with contents.

TYPE: str | Path | None DEFAULT: None

contents

The contents of the file. Can be a BufferedReader, BytesIO, or bytes. Mutually exclusive with path.

TYPE: bytes | IO[bytes] | None DEFAULT: None

format

The format of the image file or image encoding.

TYPE: ImageFormat

draw_order

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values.

TYPE: Float32Like | None DEFAULT: None