downsize 1.0.0 copy "downsize: ^1.0.0" to clipboard
downsize: ^1.0.0 copied to clipboard

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

example/downsize_example.dart

import 'dart:io';
import 'dart:typed_data';

import 'package:downsize/downsize.dart';

void main() async {
  final input = '${Directory.current.path}/example/test.png';
  final output = '${Directory.current.path}/example/compressed.png';

  Uint8List? data = File(input).readAsBytesSync();

  print('Old size: ${data.sizeKb}kb');

  data = await Downsize.downsize(data: data);

  print('New size: ${data?.sizeKb}kb');

  File(output).writeAsBytesSync(data!);
}
3
likes
0
points
13
downloads

Publisher

verified publisheryaseen.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

image

More

Packages that depend on downsize