A Flutter package for removing background from images using Apple Vision Selfie on macOS and Google ML Kit Selfie Segmentation on Android and iOS.
- Cross-platform background removal support (macOS, Android, iOS)
- Efficient background removal using Apple Vision Selfie or Google ML Kit Selfie Segmentation
- Isolate computation for improved performance
Add the following to your pubspec.yaml
file:
dependencies:
flutterbackgroundremover: ^0.0.1
import 'package:flutterbackgroundremover/flutterbackgroundremover.dart';
// Example usage
final File imageFile = ...; // Provide your image file
try {
final Uint8List result = await FlutterBackgroundRemover.removeBackground(imageFile);
// Use the result as needed, e.g., display it in your Flutter app
} catch (e) {
print("Error: $e");
}
The package uses Apple Vision Selfie on macOS and Google ML Kit Selfie Segmentation on Android and iOS. Background removal is achieved by processing an input image and generating a new image with the background removed.
Contributions are welcome! Feel free to open issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.