meo-canvas
    Preparing search index...

    Interface EncodeOptions

    Quality and container settings that only some formats read.

    A format that ignores a field ignores it. The timing fields are the exception: naming a frame rate for a format with no clock is an error rather than something quietly dropped, because a caller who wrote fps and got a still image asked for something that did not happen.

    interface EncodeOptions {
        fps?: number;
        frameDelays?: readonly number[];
        loop?: number;
        lossless?: boolean;
        matte?: string;
        page?: number;
        quality?: number;
    }
    Index
    fps?: number

    Frames per second for an animated format.

    frameDelays?: readonly number[]

    Per-frame durations in milliseconds, one per written page.

    loop?: number

    How many times an animation plays. Absent plays it forever.

    lossless?: boolean

    Whether a WebP or AVIF encode is lossless. Left out, each format follows its own rule, which for WebP is the quality: lossless at 1.

    true writes a lossless WebP, still or animated, and a lossless AVIF; beside a quality below 1 it is refused, and so it is for every other format. false writes a lossy WebP at any quality, its finest at 1. Passed to meo-skia-canvas's EncodeOptions::lossless as it is.

    matte?: string

    The colour transparency is flattened against, for a format with no alpha.

    page?: number

    Which page is written, counting from zero.

    Not only for a single-page format. Naming a page wins over a format that would otherwise gather them all, so a GIF asked for page 1 of three is a one-frame GIF and a PDF asked for one page is a one-sheet PDF. Left out, a spanning format writes every page and every other format writes the last one.

    An index past the last page is refused rather than clamped.

    quality?: number

    Lossy quality from 0 to 1, read by JPEG, WebP and AVIF. Left out, each format takes its own default.

    A WebP at 1, with lossless left out, is lossless. AVIF at 1 is its finest lossy quantizer, not lossless.