decodePng function
Decodes a PNG image from a byte array into an Image object.
Parameters:
- bytes: The PNG image data as a Uint8List.
Returns a Future that completes with the decoded Image.
Implementation
Future<Image> decodePng(Uint8List bytes) async {
final codec = await instantiateImageCodec(bytes);
return (await codec.getNextFrame()).image;
}