Trevixal API
    Preparing search index...

    Interface CompressOptions

    How hard to squeeze an upload before it leaves the browser. Every knob has a default that is safe for photographs pasted straight off a phone, which is where the multi-megabyte files come from.

    interface CompressOptions {
        maxDimension?: number;
        mimeType?: "auto" | "image/jpeg" | "image/webp";
        minBytes?: number;
        quality?: number;
    }
    Index
    maxDimension?: number

    Longest edge, in px; larger images are scaled down. Defaults to 2048.

    mimeType?: "auto" | "image/jpeg" | "image/webp"

    Output format. 'auto' keeps PNG when the image actually uses its alpha channel and switches to JPEG when it does not, flattening transparency to a black box is far worse than a bigger file.

    minBytes?: number

    Files below this many bytes are returned untouched. Defaults to 150 000.

    quality?: number

    Lossy encoder quality, 0-1. Defaults to 0.85.