Flutter Image Compression

Flutter image compression and resize for Mobile, Desktop and Web. Support format JPG, PNG, WEBP.

Combining use of packages :

Compressing Image

ImageFile input; // set the input image file
Configuration config = Configuration(
   outputType: ImageOutputType.webpThenJpg,
   // can only be true for Android and iOS while using ImageOutputType.jpg or ImageOutputType.pngÏ
   useJpgPngNativeCompressor: false,
   // set quality between 0-100
   quality: 40,
);

final param = ImageFileConfiguration(input: input, config: config);
final output = await compressor.compress(param);

print("Input size : ${input.sizeInBytes}");
print("Output size : ${Output.sizeInBytes}");

Libraries

flutter_image_compress
image_compression_flutter
image_compression_flutter_web