toPNG method
Encode to a PNG image, using the Image
library
Implementation
Uint8List toPNG() => Uint8List.fromList(
PngEncoder().encodeImage(
Image.fromBytes(
width,
height,
_bytes,
channels: _channels,
),
),
);