Skip to content
pubscout

flutter_luban

2.1.2, released 8 weeks ago by an unverified publisher

Compress images using Luban‑style algorithm for Dart/Flutter.

$ flutter pub add flutter_luban
Source repository

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.

Works with

Packages commonly used together with flutter_luban: ones it builds on, ones built on it, and its own family.