The open-source companion for all your image processing needs in Flutter.
Background Remover automatically extracts subjects and generates transparent backgrounds. Instead of relying on restrictive paid tools, you can process your images directly using this robust, cross-platform application.
- Zero-Cost Processing: Completely free and open-source. No subscriptions or hidden API limits.
- Instant Background Removal: Select an image and let the application cleanly separate the foreground subject from the background.
- Cross-Platform Support: Fully developed in Flutter, ensuring a smooth, native-like experience across different operating systems.
- Privacy First: Process images securely without necessarily sending your personal photos to third-party cloud servers.
To achieve smooth, high-performance background removal without freezing the user interface (UI), the application implements a dual-architecture image processing pipeline using conditional compilation:
graph TD
A[Image Input] --> B{Platform?}
B -- Native (iOS/Android/Desktop) --> C[Isolate-based Processor]
C --> C1["compute() with package:image"]
C1 --> C2[Background Isolate Thread]
C2 --> C3[RGB Distance + Smooth Gradient Filter]
C3 --> F[Processed PNG bytes]
B -- Web --> D[Browser Canvas Processor]
D --> D1["package:web + JS Interop"]
D1 --> D2["Browser GPU/C++ Decoding (ImageElement)"]
D2 --> D3[In-place Typed Array Pixel Processing]
D3 --> D4["canvas.toBlob() (Async Browser compression)"]
D4 --> F
For native platforms, CPU-bound image operations are executed on background threads:
- Background Isolates: The app uses Flutter's
computeutility to decode the image and apply the background removal filters on a separate native thread (Isolate). - Pure Dart Processing: The pixels are evaluated and modified using the
imagepackage in pure Dart, ensuring consistent result accuracy across all operating systems. - Responsive UI: Because the heavy computing is offloaded from the main UI thread, animations and transitions remain completely fluid (60fps/120fps).
Since browser JavaScript runs in a single-threaded environment, standard compute runs synchronously on the main thread, which can easily freeze the browser UI. To solve this, a specialized web processor is loaded conditionally:
- Native Browser Decoder: We decode the uploaded image using the browser's hardware-accelerated
HTMLImageElementin milliseconds. - Canvas Pixel Manipulation: The decoded pixels are drawn to an off-screen
HTMLCanvasElement. The app processes the pixels in-place inside the browser's optimized memory using a DartUint8ClampedListview of the JS typed array (JSUint8ClampedArray). - Asynchronous PNG Compression: Rather than performing slow Dart-based PNG compression, we offload PNG creation back to the browser using the asynchronous
canvas.toBlob(...)API. The browser compresses the image in its internal C++ thread pool, keeping the main tab responsive and resulting in near-instant processing.
- Simple Selection: Choose any photo from your device's gallery or take a new one directly from the app.
- Auto-Discovery: The app's processing engine automatically identifies the main subject of your image.
- Seamless Export: Save the resulting transparent PNG directly to your local storage or share it with other applications.
This repository is structured as a standard Flutter application.
| Directory | Description |
|---|---|
lib |
The core Dart code and UI components of the application. |
assets |
Static resources, including placeholder images and icons. |
android / ios |
Native platform configurations and bindings. |
Ensure you have the latest stable Flutter SDK installed on your machine.
Clone the repository and resolve dependencies:
git clone [https://github.com/vicajilau/unback.git](https://github.com/vicajilau/unback.git)
cd unback
# Fetch dependencies
flutter pub get
To launch the app on your connected device or emulator, run:
flutter run
Since this is a client-facing application rather than a library, usage is entirely through the graphical interface:
- Launch the app on your preferred device.
- Tap the "Upload Image" or "Camera" button.
- Wait for the processing to complete.
- Tap "Save" to download the isolated subject to your gallery.
If you wish to integrate the underlying background removal logic into your own code, check the core processing services located within the lib/services/ directory.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Copyright (C) 2026 Víctor Carreras
