flutter_photon_rs 0.0.1 copy "flutter_photon_rs: ^0.0.1" to clipboard
flutter_photon_rs: ^0.0.1 copied to clipboard

Dart ffi to photon library, an image processing library written in rust.

Photon For Flutter #

flutter_photon_rs is dart ffi to photon library, Photon is a high-performance Rust image processing library, which compiles to WebAssembly, allowing for safe, blazing-fast image processing both natively and on the web.

Supported platforms:

  • Android
  • IOS

💻 Usage #

import 'package:flutter_photon_rs/flutter_photon_rs.dart';
import 'package:image_picker/image_picker.dart';

// Use ImagePicker to get image from source and read as bytes
final _picker = ImagePicker();
final image = await _picker.getImage(
  source: ImageSource.gallery,
);

if (image != null) {
  final imageBytes = await image.readAsBytes();
  
  // returns Uint8List which you can use to store, 
  // or show on Image.memory() widget
  final bytes = await Photon.process(
    bytes: imageBytes,
    filters: [
      Monochrome.grayscale(),
      Convolution.gaussianBlur(
        radius: 20,
      ),
      Transform.flipH(),
    ],
    outputFormat: OutputFormat.Jpeg,
  );
}

🌟 Features #

  • Implement Photon rust lib all features
  • Fix Exif Reading (Image Rotation) Issue
  • Make Proper README.md with Documentation
  • Publish on pub.dev
  • Add Support For IOS
  • Write Rust And Flutter Test
  • Benchmark
  • Refactor Code for readability and efficiency
15
likes
60
pub points
0%
popularity

Publisher

unverified uploader

Dart ffi to photon library, an image processing library written in rust.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

ffigen, flutter, flutter_rust_bridge, freezed_annotation

More

Packages that depend on flutter_photon_rs