@dusrel/image API
    Preparing search index...

    Interface ImageOptions

    interface ImageOptions {
        background?: string | null;
        codecs?: CodecPluginDefinition<unknown>[];
        crop?: Rect;
        fallback?: FallbackPolicy;
        flipHorizontal?: boolean;
        flipVertical?: boolean;
        format?: string;
        maxSizeBytes?: number;
        onProgress?: (step: ProgressStep) => void;
        plugins?: ImagePlugin[];
        quality?: number;
        resize?: ResizeOptions;
        rotate?: number;
        signal?: AbortSignal;
        timeoutMs?: number;
    }

    Hierarchy (View Summary)

    Index
    background?: string | null

    Fill colour used where rotation exposes corners and when flattening transparency for JPEG. Default #ffffff for JPEG output, transparent otherwise. Set to null to force transparency (non-JPEG only).

    codecs?: CodecPluginDefinition<unknown>[]

    Codec registrations that make non-canvas formats selectable via format.

    crop?: Rect
    fallback?: FallbackPolicy
    flipHorizontal?: boolean
    flipVertical?: boolean
    format?: string

    Output format: a canvas MIME type ('image/jpeg' | 'image/png' | 'image/webp'), or the MIME type of a codec registered in codecs. An unregistered non-canvas format fails with the typed unsupported-format error - never a silent fallback.

    maxSizeBytes?: number

    Target-size mode: re-encode with descending quality (bounded binary search) until the output is at most this many bytes. Lossy formats only. When the budget cannot be met even at minimum quality, the smallest best-effort result is returned and targetSizeMet is false.

    onProgress?: (step: ProgressStep) => void
    plugins?: ImagePlugin[]

    Step plugins. On a pipeline they run at their registered position; in easy mode (processImage) they run in order after the core pass (and before a registered codec encode).

    quality?: number

    0..1, default 0.85. Ignored for PNG (lossless).

    resize?: ResizeOptions
    rotate?: number

    Degrees clockwise. Any value; multiples of 90 are exact.

    signal?: AbortSignal
    timeoutMs?: number

    Abort the operation after this many milliseconds.