Offline on-device AI image upscaling & restoration for Android (arm64-v8a).
No cloud uploads. No queues. Built with Jetpack Compose, ONNX Runtime (QNN / NNAPI), NCNN Vulkan, and MediaPipe.
- Dual-Backend Super-Resolution
- Fast Photo (
realesr-general-x4v3): Runs via ONNX Runtime targeting Qualcomm QNN HTP / Android NNAPI (with multi-threaded CPU fallback) for fast everyday photo upscaling. - Anime & Text (
realesr-animevideov3): Native2×and4×NCNN Vulkan models tuned for crisp line art, screenshots, and text. - Ultra Photo (
realesrgan-x4plus): Optional 23-RRDB heavy model (downloadable on demand inside the app) for maximum texture reconstruction.
- Fast Photo (
- Selective Face Restoration
- On-device face detection with MediaPipe BlazeFace (
blaze_face_short_range.tflite). - Supports optional neural portrait restoration (
GFPGAN v1.4ONNX pack) or lightweight local clarity enhancement blended smoothly with radial feathering.
- On-device face detection with MediaPipe BlazeFace (
- Darkroom Inspection & Export
- Pinch-to-zoom, double-tap loupe, and aspect-preserving before/after split comparison.
- EXIF-orientation-aware OOM-safe decoding, alpha channel preservation, WorkManager foreground execution, and Scoped Storage export (
PNG,JPEG,WEBP) toPictures/PixelForge.
app/src/main/
├── cpp/ # C++17 NCNN + Vulkan inference engine & mutex-guarded JNI bridge
├── java/com/pixelforge/app/
│ ├── bridge/ # NativeLoader & RealesrganBridge
│ ├── core/ # EXIF-safe Bitmap decoding, ImageAnalyzer, MediaStoreUtils
│ ├── data/ # Room database (v2), DataStore settings, ModelManager, cache
│ ├── di/ # Hilt modules
│ ├── domain/ # Models, repository contracts, use cases
│ ├── engine/ # EngineSelector, OrtNpuUpscaleEngine, NcnnUpscaleEngine, FaceRestorationPipeline, PostProcessor
│ ├── presentation/ # Darkroom Material 3 Compose UI (Home, Editor, Processing, Result, History, Settings)
│ └── worker/ # WorkManager foreground UpscaleWorker
└── assets/models/ # Bundled compact models (ONNX general-x4v3, NCNN animevideov3, BlazeFace)
- Android Studio / JDK 17
- Android SDK
compileSdk = 35,minSdk = 31, and Android NDK + CMake3.22.1 arm64-v8aprebuilt NCNN + glslang static libraries placed inapp/src/main/jniLibs/arm64-v8a/(excluded from git via.gitignore):- Download
ncnn-20260113-android-vulkan.zipfrom Tencent/ncnn releases. - Copy the
arm64-v8a/includeandarm64-v8a/libdirectories intoapp/src/main/jniLibs/arm64-v8a/. libomp.sois copied automatically from your local NDK by thecopyLibOmpGradle task.
- Download
# Run unit tests and Android Lint
./gradlew testDebugUnitTest lintDebug
# Build and install debug APK on a connected arm64-v8a device
./gradlew installDebug
# Run on-device instrumentation & engine smoke tests
./gradlew connectedDebugAndroidTest
# Build release APK
./gradlew assembleReleaseSee ROADMAP.md for planned improvements to inference speed, image quality, and UX.
Licensed under the GNU General Public License v3.0.