Skip to content
pubscout

downsize

1.1.0, released 2 years ago by yaseen.dev

Pure Dart image compression across multiple formats like JPG, PNG, GIF, BMP, TIFF, TGA, PVR, and ICO.

WASM-ready
$ flutter pub add downsize
Source repository

What it does

Downsize is a pure Dart image compression library that reduces image file sizes while maintaining quality. It offers dynamic resizing, format-specific compression, and built-in extensions for File and Uint8List objects.

AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to compress various image formats in pure Dart without platform-specific native dependencies.
  • You want to optimize image sizes for web or mobile apps by targeting specific file sizes or minimum quality.

Skip it when

  • You require advanced image editing features like cropping or filters, which are not the primary focus.
  • You need a UI component for loading and caching images from the network.

Strengths

  • Supports a wide range of image formats including JPG, PNG, GIF, BMP, TIFF, TGA, PVR, and ICO.
  • Pure Dart implementation works across multiple platforms (Android, iOS, Web, Windows, macOS, Linux).
  • Easy-to-use extensions directly on File and Uint8List classes.

Weaknesses

  • Relies entirely on the underlying image package capabilities.
  • Limited built-in documentation on advanced configuration options beyond basic size and quality settings.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'dart:io';
import 'package:downsize/downsize.dart';

void main() async {
  File imageFile = File('path/to/your/image.jpg');
  Uint8List imageData = await imageFile.readAsBytes();
  Uint8List? compressedData = await Downsize.downsize(data: imageData, maxSize: 500, minQuality: 60);
}

Alternatives

Packages that do the same job and could replace downsize.

Works with

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