flutter_remove_bg 0.0.2
flutter_remove_bg: ^0.0.2 copied to clipboard
A Flutter package that removes background from images using remove.bg API. Simple to use with support for both local files and image URLs.
Remove.bg #
A Flutter package that provides easy integration with the Remove.bg API to remove backgrounds from images.
Features #
- Remove background from local image files
- Remove background from image URLs
- Simple and easy-to-use API
- Supports both Android and iOS
Getting Started #
Prerequisites #
- Sign up for a Remove.bg API key at remove.bg
- Add the package to your
pubspec.yaml:
dependencies:
remove_bg: ^0.0.1
- Run:
flutter pub get
Usage #
- Initialize the RemoveBg class with your API key:
final removeBg = RemoveBg(apiKey: 'YOUR_API_KEY_HERE');
- Remove background from a local image:
try {
final processedImageBytes = await removeBg.removeBackground('/path/to/image.jpg');
// Save or display the processed image
} catch (e) {
print('Error: $e');
}
- Remove background from an image URL:
try {
final processedImageBytes = await removeBg.removeBackgroundFromUrl('https://example.com/image.jpg');
// Save or display the processed image
} catch (e) {
print('Error: $e');
}
Example #
Check out the example directory for a complete sample application.
Additional Information #
For more information about the Remove.bg API, visit their API documentation.
License #
This project is licensed under the MIT License - see the LICENSE file for details.