asImage method

Image asImage()

Returns the image as an Image object from the pub:image library

Implementation

im.Image asImage() {
  return im.Image.fromBytes(
    width: width,
    height: height,
    bytes: pixels.buffer,
    format: im.Format.uint8,
    numChannels: 4,
  );
}