Interface AnimationDecodeOptions

Options of Animation.decode

interface AnimationDecodeOptions {
    applyColorProfile?: boolean;
    maxPixels?: number;
    onlyFirstFrame?: boolean;
    threads?: number;
}

Properties

applyColorProfile?: boolean

Whether to convert the colors of frames with an embedded ICC profile (APNGs, WebPs) to sRGB, like applyColorProfile of Image.decode. Default: true

maxPixels?: number

The most pixels to decode, of all frames together (every frame is a full canvas): larger animations throw a RangeError before anything that size is allocated, so small files declaring huge animations (decompression bombs) can't exhaust the memory. Default: 268402689 (16383², like sharp), Infinity for no limit

onlyFirstFrame?: boolean

Whether to stop decoding after the first frame. Default: false

threads?: number

At most this many worker threads decode in parallel, like threads of Image.decode. Default: the processors available, at most 8