flutter_luban 2.1.1
flutter_luban: ^2.1.1 copied to clipboard
An image compress package like Luban for Dart, based on image. This library has no system platform constraints.
flutter_luban #
An image compress package like Luban for Dart, based on image.
If toRgb: true , it supports all readable image formats
Example #
CompressObject compressObject = CompressObject(
imageXFile: imageXFile, //image file
path: tempDir.path, //compress to path, default Directory.systemTemp.path
useCache: true, //If there is a cache, no compression will be performed
toRgb: true, //Convert the image to jpg
numberOfColors: 128, //the numberOfColors of image.quantize
);
Luban.compressImage(compressObject).then((xfile) {
setState(() {
print(xfile.path);
});
});
