talira

flutter_image_compress

Native image compression for Flutter apps

open sourceMITfree

flutter_image_compress is a Flutter plugin that compresses images with each platform's native encoder (Kotlin on Android, Objective-C and Swift on Apple platforms), which is much faster than compressing in Dart. It runs on Android, iOS, macOS, the web and OpenHarmony, compresses from bytes, assets or files, resizes to a minimum width and height, rotates, sets quality, writes JPEG, PNG, WebP or HEIC, and can keep EXIF metadata. Support for each format and option varies by platform.

Problems it solves

  • shrink photos before uploading them from my Flutter app
  • compress images to WebP in Flutter
  • resize a picture taken in my Flutter app before sending it

Features

  • native encoders on each platform
  • compress from bytes, assets or files
  • resize, rotate and set quality
  • JPEG, PNG, WebP and HEIC output
  • optional EXIF preservation

Limitations

  • Platform support varies: on the web, file-based compression, HEIC output, rotation and EXIF preservation aren't available; OpenHarmony doesn't keep EXIF; and macOS can't write WebP.1

Alternatives

The same job

These do what flutter_image_compress does.

  1. Cloudflare Images Resize, optimise, store and deliver images at Cloudflare's edge
  2. Squoosh Make images smaller with modern codecs, right in the browser

Compare flutter_image_compress with the top 3