5Gears0Chill / image_compression_flutter_latest

A Flutter extension to compress and resize the images (JPG, PNG, WEBP).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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}");

About

A Flutter extension to compress and resize the images (JPG, PNG, WEBP).

License:Other


Languages

Language:Dart 34.9%Language:C++ 29.4%Language:CMake 19.5%Language:Ruby 5.2%Language:C 3.1%Language:Swift 2.8%Language:HTML 1.8%Language:Kotlin 1.6%Language:Makefile 1.0%Language:Objective-C 0.9%