browser-image
    Preparing search index...

    Interface WarpOptions

    Options for warp.

    interface WarpOptions {
        resample?: Resample;
        background?: RGBA;
        extent?: readonly [number, number, number, number];
        pixelSize?: number | readonly [number, number];
        width?: number;
        height?: number;
        coordinateTransform?: CoordinateTransform;
        gridStep?: number;
        tolerance?: number;
        yUp?: boolean;
        edges?: "transparent" | "clamp";
        output?: OutputKind;
        type?: string;
        quality?: number;
        worker?: boolean;
        signal?: AbortSignal;
    }

    Hierarchy (View Summary)

    Index
    resample?: Resample

    Interpolation. Default bilinear.

    background?: RGBA

    Color of pixels that fall outside the source. Default transparent [0, 0, 0, 0].

    extent?: readonly [number, number, number, number]

    Output area [minX, minY, maxX, maxY] in output coordinates (the transform's target, or coordinateTransform's output). Default: the whole transformed source.

    pixelSize?: number | readonly [number, number]

    Output pixel size in output coordinates, one number or [x, y]. Default: about the source resolution.

    width?: number

    Output width in pixels. With height, overrides pixelSize; alone, keeps pixels square.

    height?: number

    Output height in pixels.

    coordinateTransform?: CoordinateTransform

    Converts the transform's target coordinates to the output's (e.g. proj4('EPSG:4326', 'EPSG:3857')). Runs on the main thread on a coarse grid.

    gridStep?: number

    Grid spacing in output pixels for coordinateTransform. Default 32.

    tolerance?: number

    Largest allowed grid interpolation error, in source pixels. Default 0.125.

    yUp?: boolean

    Overrides the transform's yUp: true puts the largest y at the top of the output.

    edges?: "transparent" | "clamp"

    What sampling reads beyond the source's outer pixel centers. transparent (default) fades the edge out, which keeps the outline of a warped image smooth; clamp repeats the edge pixels, for outputs that lie wholly on the source (a resize), so opaque images stay opaque up to their border.

    output?: OutputKind

    Result type. Default imageData.

    type?: string

    Encoding for output: 'blob'. Default image/png.

    quality?: number

    Encoder quality 0-1 for lossy types.

    worker?: boolean

    Run in Web Workers (default true). Falls back to the main thread automatically.

    signal?: AbortSignal

    Cancels the warp; the promise rejects with an AbortError.