Interface AVIFEncodeOptions

Options of Image.encodeAVIF

interface AVIFEncodeOptions {
    alphaQuality?: number;
    effort?: number;
    metadata?: Metadata;
    quality?: number;
    subsampling?: "4:4:4" | "4:2:0";
    threads?: number;
}

Properties

alphaQuality?: number

The quality of the alpha channel (if the image has transparency), like avifenc's. Default: 100 (lossless)

effort?: number

How hard the encoder searches for the best modes: 0-2, faster to smaller. Default: 1

metadata?: Metadata

Metadata to include, see Metadata

quality?: number

0-100, like avifenc's: higher is better and larger, 100 is lossless. Default: 60

subsampling?: "4:4:4" | "4:2:0"

Chroma subsampling: '4:4:4' keeps the full color resolution, '4:2:0' halves it (smaller). Default: '4:4:4'

threads?: number

At most this many worker threads encode in parallel (the same file, faster: 2.9 times with 8 on a 1920x1080 photo at effort 1), 1 for none. Small images (under about 640x640 pixels at effort 0, 448x448 at 1, 320x320 at 2), and runtimes whose workers can't share memory (browsers without cross-origin isolation), encode without them. Default: the processors available, at most 8