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

    InterfaceWebPEncodeOptions

    Options of Image.encodeWebP

    interface WebPEncodeOptions {
        alphaQuality?: number;
        effort?: number;
        metadata?: Metadata;
        quality?: number;
        sharpYuv?: boolean;
        threads?: number;
    }

    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

    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

    threads?: number

    For lossless compression, the maximum worker threads to use. Small images or runtimes that cannot share memory between workers use one thread

    Where workers can't start, the work runs on the calling thread with the same output. That includes browser pages that aren't cross-origin isolated and ones that load the package from another origin (a CDN such as jsDelivr), which browsers don't allow to start workers

    The available processors, up to 8