Cross-platform image processing library written in Rust.
Run the same filters natively on CLI, Android, iOS, Flutter, and WebAssembly from a single codebase.
Spiritual successor to an old Java/C# college project, rebuilt from scratch with a modern Rust core.
CLI Flutter iOS Web Android
│ (dart:ffi) (C FFI) (WASM) (JNI/NDK)
│ │ │ │ │
└────────┴─────────┴───────┴───────┘
│
silvestre-ffi (C ABI)
│
silvestre-core (Pure Rust)
silvestre-core contains all image processing logic as a pure Rust library. silvestre-ffi exposes it through a C ABI so every platform can consume it via its native FFI mechanism.
Canny edge detection, Median, Gaussian blur, Sobel, Sharpen, Box blur
Grayscale, Sepia, Invert, Brightness, Contrast
Resize (nearest-neighbor & bilinear), Rotate, Mirror/Flip, Crop
Histogram computation, Image statistics
PNG, JPEG, BMP, WebP — load and save via the image crate
silvestre/
├── silvestre-core/ # Pure Rust image processing library
├── silvestre-ffi/ # C ABI foreign function interface
├── silvestre-cli/ # Command-line tool
├── silvestre-wasm/ # WebAssembly bindings (planned)
├── silvestre-flutter/ # Flutter package via flutter_rust_bridge (planned)
└── tests/
└── fixtures/ # Test images
- Rust 1.70+
cargo build --workspacecargo test --workspace# Apply a filter
cargo run -p silvestre-cli -- apply median --input photo.jpg --output out.jpg
# List available filters
cargo run -p silvestre-cli -- listuse silvestre_core::{SilvestreImage, Filter};
// Load an image
let img = SilvestreImage::load("photo.png")?;
// Apply a filter (once implemented)
// let result = MedianFilter::new(3).apply(&img)?;
// Save the result
// result.save("output.png")?;| Platform | Mechanism | Status |
|---|---|---|
| CLI | Native binary | In progress |
| WebAssembly | wasm-bindgen + wasm-pack |
Planned |
| Flutter | flutter_rust_bridge v2 |
Planned |
| Android | Rust → C ABI → JNI (NDK) | Planned |
| iOS | Rust → C ABI → Swift interop | Planned |
| Component | Technology |
|---|---|
| Core library | Rust |
| Image codec | image 0.25 |
| Error handling | thiserror 2 |
| CLI | clap 4 |
| C header gen | cbindgen |
| WASM | wasm-bindgen |
| Flutter bridge | flutter_rust_bridge v2 |
| Testing | cargo test + proptest |
| Benchmarks | criterion |
See PLAN.md for the full implementation plan.
- Core library — image types, filters, effects, transforms, analysis
- CLI tool — apply filters from the command line
- C FFI layer — stable ABI for platform bindings
- WebAssembly — run in the browser
- Flutter package — Android, iOS, and desktop via
flutter_rust_bridge - Polish & release — CI, docs, publish to crates.io / pub.dev / npm
MIT