window.kaolin
    Preparing search index...

    Function uploadImage

    • Prompt the user to pick an image file and decode it to pixels.

      Opens a transient <input type="file"> picker; once the user chooses a file it is decoded via imageDataFromBlob at its natural size. Resolves with the decoded ImageData, or null if the user cancels or decoding fails. Must be called from a user gesture (e.g. a click handler) for the picker to open.

      Parameters

      • accept: string = 'image/*'

        accept filter for the file picker; defaults to 'image/*'.

      Returns Promise<ImageData>

      The decoded ImageData, or null if cancelled or decoding failed.