JAXA Earth API for JavaScript
    Preparing search index...

    Interface ImageDataObject

    Intermediate data of an image produced by visualizing a DataObject according to the conditions of a ColorMap. The RGBA color components are stored as a Uint8ClampedArray. It is almost the same as the ImageData available in browser and Deno environments, but it is defined independently so that it can be used uniformly even in Node.js and Bun environments where ImageData is not available.

    Depending on the runtime environment, use the following functions to convert it to a final image.

    If an ImageDataObject is not needed, the following functions can convert directly from a DataObject and a ColorMap to an image.

    • createCanvas (converts to HTMLCanvasElement, limited to the browser main thread)
    • createOffscreenCanvas (converts to OffscreenCanvas, limited to the browser main thread or a web worker)
    • createPng (converts to a Uint8Array of a PNG image in browser, Node.js, Deno, and Bun)
    interface ImageDataObject {
        width: number;
        height: number;
        data: Uint8ClampedArray;
    }
    Index

    Properties

    Properties

    width: number

    The width of the image (number of pixels).

    height: number

    The height of the image (number of pixels).

    data: Uint8ClampedArray

    A one-dimensional array (Uint8ClampedArray) that stores the color of each pixel in the order R (red component) -> G (green component) -> B (blue component) -> A (alpha component), proceeding from the top-left to the top-right of the image and from top to bottom. The number of elements in the array is width * height * 4.