← 输入框|imagescript.dev|刷新
ImageScript v4.1.0
    Preparing search index...

    InterfaceWebPAnimationEncodeOptions

    Options of Animation.encodeWebP and Animation.webpEncoder: those of WebPEncodeOptions for every frame (but threads: the frames are encoded one at a time), and the animation options. Without quality the frames are lossless

    interface WebPAnimationEncodeOptions {
        alphaQuality?: number;
        effort?: number;
        metadata?: Metadata;
        optimize?: boolean;
        quality?: number;
        sharpYuv?: boolean;
    }

    Hierarchy (View Summary)

    Index
    alphaQuality?: number

    For lossy compression, the transparency (alpha) channel's quality (0-100). Lower values may make the image smaller but can make transparency look less smooth

    100 (full quality)

    effort?: number

    Compression effort (0-6): higher values usually take longer but may make smaller files. For lossless images, 0 prioritizes speed; 2 and above spend more time reducing file size (lossless images are encoded the same at 2 and above)

    2

    metadata?: Metadata

    Metadata to include, see Metadata

    optimize?: boolean

    Whether to store each frame as the area that changed since the frame before and merge identical frames, which usually makes files a lot smaller. The file shows the same animation either way, but only decodes to the same frames without it, which also encodes faster when little changes. The exception is GIF, which has no partial transparency: without optimize, a semi-transparent pixel becomes opaque or transparent in its own frame, with it the frames are composited first

    true

    quality?: number

    Lossy compression (0-100): higher values usually preserve more detail but make larger files. 100, like no quality, encodes losslessly and keeps every pixel exact (99 is the highest lossy quality)

    sharpYuv?: boolean

    For lossy compression: improve color detail around sharp edges (for example, red text on a blue background). This can take longer and make graphics larger

    false