imgcompress 1.0.0 copy "imgcompress: ^1.0.0" to clipboard
imgcompress: ^1.0.0 copied to clipboard

Compress JPEG Images in Flutter Using MozJpeg

imgcompress #

pub package

Compress JPEG Images in Flutter Using MozJpeg

Getting Started #

It is really easy to use! You should ensure that you add the imgcompress as a dependency in your flutter project.

imgcompress: "^1.0.0"

screenshot.png

Usage #

New instance

final _imgCompress = FlutterImgCompress.instance;

Compress Jpeg

final imgBytes = await rootBundle.load('assets/images/img.jpg');
final image = imgBytes.buffer.asUint8List();

final imgDecode = img.decodeImage(image)!;
final width = imgDecode.width;
final height = imgDecode.height;
const quality = 90.0;

var data = await _imgCompress.compress(ImgCompressOption(
  image,
  quality: quality,
  width: width,
  height: height,
  format: ImgCompressFormat.jpeg,
));
0
likes
130
pub points
0%
popularity

Publisher

unverified uploader

Compress JPEG Images in Flutter Using MozJpeg

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_rust_bridge, meta, uuid

More

Packages that depend on imgcompress