omni-compress - v2.3.1
    Preparing search index...

    Interface ImageOptions

    Options for compressImage().

    interface ImageOptions {
        format?: "webp" | "avif" | "jpeg" | "png" | "auto";
        quality?: number;
        maxWidth?: number;
        maxHeight?: number;
        preserveMetadata?: boolean;
        strict?: boolean;
        useWorker?: boolean;
        onProgress?: (percent: number) => void;
        signal?: AbortSignal;
    }
    Index

    Properties

    format?: "webp" | "avif" | "jpeg" | "png" | "auto"

    Target output format. Default: 'auto' (converts PNG/JPEG to WebP).

    quality?: number

    Encoder quality from 0.0 (worst) to 1.0 (best). Default: 0.8.

    maxWidth?: number

    Resize output width to at most this many pixels (maintains aspect ratio).

    maxHeight?: number

    Resize output height to at most this many pixels (maintains aspect ratio).

    preserveMetadata?: boolean

    When true, EXIF/metadata is preserved in the output. Default: false (stripped).

    strict?: boolean

    If the compressed image is larger than the original, return the original. Default: false.

    useWorker?: boolean

    Explicitly force Web Worker usage (true) or Main Thread usage (false). If omitted, the library chooses based on file size and operation type.

    onProgress?: (percent: number) => void

    Called with progress 0–100 during heavy-path (FFmpeg) operations.

    signal?: AbortSignal

    Cancel the operation. Throws AbortError when signalled.