Skip to content

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

License

Notifications You must be signed in to change notification settings

xujiaji/image_compression_flutter

 
 

Repository files navigation

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).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 34.8%
  • C++ 29.3%
  • CMake 19.4%
  • Ruby 5.2%
  • C 3.1%
  • Swift 2.9%
  • Other 5.3%