Search categories, packages and repositories

flutter_luban cover
Package detailsv2.1.2

flutter_luban

An image compress package like Luban for Dart, based on image. This library has no system platform constraints.

AndroidiOSmacOSWindowsLinux
30-day downloads
785
Likes
101
Pub points
130

Install package

flutter pub add flutter_luban

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_luban is a Dart-based image compression package inspired by Luban, designed to reduce image file sizes without significant quality loss. It operates independently of the underlying platform, making it compatible with Android, iOS, macOS, Windows, and Linux. The library leverages efficient image processing algorithms to deliver optimized output suitable for web and mobile applications. Ideal for apps requiring fast, reliable image optimization during upload or storage.

Use cases

  • Image optimization before upload
  • Reducing app storage usage
  • Improving media loading performance
  • Preparing images for web delivery
  • Automated image compression in workflows

Key features

  • Cross-platform compatibility
  • High compression efficiency
  • Minimal quality degradation
  • No native platform dependencies
  • Simple integration via Flutter pub

Suitable for

  • Mobile and desktop apps needing image compression
  • Developers prioritizing performance and size
  • Apps handling large volumes of user-uploaded images
  • Projects requiring consistent compression across platforms
  • Flutter apps with multimedia content

Considerations

  • May require testing for edge-case image formats
  • Compression ratio varies based on input image
  • Not suitable for lossless compression needs
  • Limited customization compared to advanced image libraries
  • Depends on underlying image processing accuracy

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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);
        });
    });

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.