Represents an image in a format that can be consumed by the WASM module.

Hierarchy

Methods

  • Converts the image to a JPEG image. The binary data of the JPEG image is returned as a Uint8Array. Note that the ScanbotSDK must be successfully initialized before calling this method.

    Parameters

    • Optional quality: number

      The quality of the JPEG image, from 0 to 100, where larger numbers mean better quality but also larger file size.

    • Optional consumeImage: Config.ConsumeType

      Controls if the image can still be used after calling this method, or if it will be consumed by the method. See ConsumeType for more details.

    Returns Promise<Uint8Array>

  • Parameters

    • data: ArrayBuffer | Uint8Array

      The binary data of the encoded image. Data must be in JPEG or PNG format. Note that you cannot pass the binary data of an ImageData object here, because ImageData.data are raw pixel values, not JPEG or PNG encoded data. For ImageData objects, use Image.fromImageData instead.

    Returns Image

  • Parameters

    • imageData: ImageData

    Returns Image

  • Load an JPEG or PNG image from a URL.

    Parameters

    • url: string

    Returns Promise<Image>

Generated using TypeDoc