Future<Uint8List?> convertUIImageToUint8List(ui.Image image) async { var byteData = await image.toByteData(format: ui.ImageByteFormat.png); return byteData?.buffer.asUint8List(); }