@dusrel/image API
    Preparing search index...

    Function optimize

    @dusrel/image-oxipng

    Lossless PNG optimisation via the Rust oxipng crate (WASM, lazy-loaded): oxipng preset levels 0..6, metadata chunk stripping and the Adam7 interlace control the png crate's encoder lacks. Pixels are never changed — only the encoding gets smaller.

    • Losslessly optimises PNG bytes: same pixels, smaller file. Rejects when the input is not a PNG or cannot be optimised.

      Parameters

      • data: ArrayBuffer | Uint8Array<ArrayBufferLike>
      • options: OxipngOptions = {}

      Returns Promise<ArrayBuffer>