flutter_luban
2.1.2, released 8 weeks ago by an unverified publisher
Compress images using Luban‑style algorithm for Dart/Flutter.
What it does
Provides a simple API to compress image files with configurable quality, target size, and caching. Works across mobile, web, and desktop platforms using the image and cross_file packages.
AI-written summary of version 2.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need fast, loss‑y image compression without native code
- You want a pure‑Dart solution that runs on all Flutter platforms
Skip it when
- Precise, lossless compression is required
- You need advanced editing features beyond compression
Strengths
- Pure Dart, no platform‑specific setup
- Cross‑platform support including web
- Cache support to avoid repeated work
Weaknesses
- Limited to lossy compression, no advanced editing
- Algorithm may not match native compressors in speed
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
CompressObject compressObject = CompressObject(
imageXFile: imageXFile,
path: tempDir.path,
useCache: true,
toRgb: true,
numberOfColors: 128,
);
Luban.compressImage(compressObject).then((xfile) {
print(xfile.path);
});Alternatives
Packages that do the same job and could replace flutter_luban.
- image_cropper
A Flutter plugin for Android, iOS and Web supports cropping images
84Compare - fc_native_image_resize
A Flutter plugin to resize images via native APIs.
69Compare - flutter_bicubic_resize
Fast native image resize, crop, and compression for Flutter using FFI.
71Compare - image_compression
A Dart extension for the image package to compress and resize images.
50Compare
Works with
Packages commonly used together with flutter_luban: ones it builds on, ones built on it, and its own family.