asImage method

Image asImage()
inherited

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,
    bytesOffset: pixels.offsetInBytes,
    format: im.Format.uint8,
    numChannels: 4,
  );
}