Method Image.AVIF.encode()


Method encode

string(8bit) encode(Image.Image image, mapping(string:int|Image.Image)|void options)

Description

Encode an image as AVIF.

Parameter options
"quality" : int

Quality 0 (worst) to 100 (lossless). Defaults to 60.

"quality_alpha" : int

Alpha quality 0 (worst) to 100 (lossless). Defaults to 100.

"lossless" : bool

Enable lossless encoding. Forces quality 100, YUV444, and identity matrix coefficients.

"speed" : int

Encoder effort, 0 (slowest/best) to 10 (fastest/worst). Defaults to SPEED_DEFAULT.

"depth" : int

Bit depth per channel, 8 or 10. Defaults to 8.

"alpha" : Image.Image

Alpha channel image. The red component is used as alpha. Must be the same dimensions as image.

Returns

The encoded AVIF data as a string.