FLUTTER ECOSYSTEM

crazecoder/flutter_luban

An image compress package like Luban for Dart

flutter_luban project cover
Stars
216
Forks
54
Last push (UTC)
Aug 27, 2026
Project status
Active
1/2 GitHub avatar
GITHUB User

1/2 ↗

Mars
LanguagesDartObjective-C

Technical topics

Packages published by this repository

Dependencies used

Dependency list 4 items
  • flutter{"sdk":"flutter"}
  • image^4.9.2
  • cross_file^0.3.5+5
  • flutter_testDevelopment{"sdk":"flutter"}

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

flutter_luban

pub package

An image compress package like Luban for Dart, based on image.

If toRgb: true , it supports all readable image formats

Readable Format

Example
   CompressObject compressObject = CompressObject(
         imageXFile: imageXFile, //image file
         path: tempDir.path, //compress to path, default Directory.systemTemp.path
         useCache: true, //If there is a cache, no compression will be performed
         toRgb: true, //Convert the image to jpg
         numberOfColors: 128, //the numberOfColors of image.quantize
       );
    Luban.compressImage(compressObject).then((xfile) {
        setState(() {
          print(xfile.path);
        });
    });

https://github.com/crazecoder/flutter_luban/blob/62bae66c5d067db82117038c6bb8bac2d54e14f9/screenshot/test.png?raw=true