OneCompress is a high performance cross-platform media compression application built with Flutter for the presentation layer and Rust for native FFI compression execution.
- High performance batch image compression for JPEG, PNG, and WebP formats
- Interactive before and after image comparison preview slider
- Granular single image tuning and re-compression
- Custom presets for quality, format conversion, and dimension resizing
- Background multi-threaded isolate execution via Rust FFI
- Graceful automatic fallback to Dart raster engine if native binaries are absent
- Direct gallery integration for saving compressed artifacts
The project follows Clean Architecture principles, isolating UI, domain business logic, and data sources:
lib/
app/ App configuration and dependency root
core/ Theme tokens, shared utilities, core components
features/
image_compression/
application/ Dependency injection and binding
data/ File picker, FFI native engine, gallery saver
domain/ Entities, use cases, repository interfaces
presentation/ Controllers, screens, interactive widgets
rust/
image_engine/ High performance Rust compression engine
The Rust core is integrated using flutter_rust_bridge and native FFI:
- Android: Packaged native libraries per ABI (.so) in jniLibs
- iOS and macOS: Statically linked native library (.a)
- Desktop (Linux and Windows): Dynamically linked engine library (.so / .dll)
If native libraries are unavailable, the application seamlessly falls back to a pure Dart implementation without interrupting the user workflow.
-
Fetch Flutter dependencies:
flutter pub get
-
Build local Rust engine for desktop development:
make rust-engine-debug
-
Run the application:
flutter run
To compile native Rust binaries for target platforms, ensure required target toolchains are installed:
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
rustup target add aarch64-apple-darwin x86_64-apple-darwin