window.kaolin
    Preparing search index...

    Function imageDataFromBlob

    • Decode an image Blob into its RGBA pixels as an ImageData, at the image's own (natural) size.

      Accepts any format createImageBitmap supports (PNG, JPEG, ...). The blob is decoded and drawn onto a scratch canvas to read back its pixels. This is the client-side counterpart to a file upload: a File from an <input type="file"> is already a Blob and can be passed directly (see uploadImage).

      Parameters

      • blob: Blob

        Image blob to decode.

      Returns Promise<ImageData>

      The decoded ImageData at the image's natural size, or null if decoding fails or no 2D context is available.