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

  1. Sign up for a Remove.bg API key at remove.bg
  2. Add the package to your pubspec.yaml:
dependencies:
  remove_bg: ^0.0.1
  1. Run:
flutter pub get

Usage

  1. Initialize the RemoveBg class with your API key:
final removeBg = RemoveBg(apiKey: 'YOUR_API_KEY_HERE');
  1. 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');
}
  1. 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.

flutter_remove_bg

Libraries

flutter_remove_bg