local_rembg
一个用于在图像中进行离线后台去除的 Flutter 插件,非常适合增强移动应用中的照片编辑功能。
本地 Rembg,一个用于在离线状态下从图像中移除背景的 Flutter 插件(Android/iOS)。
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^3.0.0以下为英文项目原文快照,最新内容请访问 GitHub。
The Background Removal Library is a powerful tool designed to seamlessly remove backgrounds from images in both Android and iOS platforms.This library provides developers with an easy-to-use interface to integrate background removal functionality into their mobile applications, enhancing user experience and enabling a wide range of creative possibilities.
Add the plugin package to the pubspec.yaml file in your project:
If you only require person detection on iOS,consider using version 0.0.8 to reduce your app's size.
dependencies:
local_rembg: ^1.1.3
Install the new dependency:
flutter pub get
Call the removeBackground function in your code:
Future<LocalRembgResultModel> removeBackground() async {
LocalRembgResultModel localRembgResultModel = await LocalRembg.removeBackground(
imagePath: // Your Image Path ,
imageUint8List: // Your image Uint8List ,
cropTheImage: // Crop the segmented image (Default true) ,
);
return localRembgResultModel;
}
Explore our Example Project to see how the Local Rembg SDK can be used in a Flutter application.
This library is provided under the Apache License.