pixer 0.0.8 copy "pixer: ^0.0.8" to clipboard
pixer: ^0.0.8 copied to clipboard

High-performance Dart image manipulation backed by Rust FFI for resizing, cropping, encoding, and thumbnail generation in apps and tools.

example/pixer_example.dart

import 'dart:io';

import 'package:pixer/pixer.dart';

void main(List<String> args) {
  if (args.length != 2) {
    stderr.writeln(
      'Usage: dart run example/pixer_example.dart <input> <output>',
    );
    exitCode = 64;
    return;
  }

  final image = Pixer.fromFile(args[0]);
  Pixer? thumbnail;
  try {
    thumbnail = image.resize(800, 600);
    thumbnail.saveToFile(args[1]);

    final metadata = thumbnail.getMetadata();
    stdout.writeln(
      'Wrote ${metadata.width}x${metadata.height} image to ${args[1]}',
    );
  } finally {
    thumbnail?.dispose();
    image.dispose();
  }
}
47
likes
160
points
362
downloads

Documentation

API reference

Publisher

verified publisherlazebny.io

Weekly Downloads

High-performance Dart image manipulation backed by Rust FFI for resizing, cropping, encoding, and thumbnail generation in apps and tools.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

code_assets, crypto, ffi, hooks, native_toolchain_rust

More

Packages that depend on pixer