Skip to content

Instantly share code, notes, and snippets.

Avatar
😁
I may be slow to respond.

Rafael Almeida Barbosa RafaelBarbosatec

😁
I may be slow to respond.
View GitHub Profile
View image_converter.dart
// imgLib -> Image package from https://pub.dartlang.org/packages/image
import 'package:image/image.dart' as imglib;
import 'package:camera/camera.dart';
Future<List<int>> convertImagetoPng(CameraImage image) async {
try {
imglib.Image img;
if (image.format.group == ImageFormatGroup.yuv420) {
img = _convertYUV420(image);
} else if (image.format.group == ImageFormatGroup.bgra8888) {