Image.toBuffer Method

Module: Image

Definition

Exports the image to a buffer.

The compression level meaning depends on the algorithm used:

  • For JPEG compression, the value is the expected quality and may vary from 1 to 100.

  • For JPEG2000 compression, the value is the compression rate and may vary from 1 to 512.

  • For PNG compression, the value is the compression rate and may vary from 1 to 10.

  • For all other formats, the value is ignored.

Uint8List toBuffer(ImageFormat imageFormat, double compressionLevel)

Parameters

imageFormat ImageFormat
in The image format to export the image to.

compressionLevel double
in The compression level to be applied.

Returns

Uint8List
Buffer that receives the image data.

Exceptions

An error has occurred during Face Library execution.