Function imageBitmapToBlob

  • Convert an image ImageBitmap or CanvasImageSource to a blob.

    Parameters

    • bitmap: CanvasImageSource

      image to convert

    • maxWidth: number = 8192

      maximum width of the image (default: 8192). Images larger than this will be scaled down. This is because strings can get too long.

    • detachBitmap: boolean = false

      detach the bitmap after conversion (default: false). This will free up bitmap memory if you don't need it anymore.

    • type: string = 'image/png'

      mime type of the blob (default: 'image/png')

      See also imageUrlToImageData, imageBitmapToCanvas, imageBitmapToBase64

    Returns Promise<Blob>

Generated using TypeDoc