native_cutout 0.3.0
native_cutout: ^0.3.0 copied to clipboard
On-device background removal for Flutter. iOS Vision (iOS 17+) and Android ML Kit (model downloaded on demand). Outputs transparent PNG.
0.3.0 #
- Added
CutoutSuccess.subjectBounds: the subject's alpha bounding box in pixel coordinates of the returned image, computed natively during mask generation (iOS scans the Vision soft mask, Android reuses the bounds already tracked while applying the ML Kit mask). Consumers that need the subject's position or size no longer have to scan the decoded image's alpha channel in Dart — a full-resolution scan on the main isolate can block the UI thread for seconds on large photos and get reported as an app hang. - With
cropToSubject: truethe returned image is the subject crop, sosubjectBoundsequals the full image rect. - Method channel success payload changed from a bare
String/bytes to a map (path/bytes+ optionalsubjectBounds). The Dart layer still parses the old scalar payloads, so mixed versions fail soft (bounds becomenull).
0.2.0 #
- Lowered the iOS pod platform from 17.0 to 13.0 so consuming apps no longer need to raise their deployment target. Background removal still requires iOS 17 at runtime and now returns the
UNSUPPORTED_OSerror on older systems. - Clarified Android ML Kit model delivery in the README: the segmentation model is not bundled and is downloaded by Google Play services on demand. First call to
removeBackgroundwill implicitly download the model when missing. - Added Simplified Chinese translation (
README.zh-CN.md) and a language switcher in the English README. - Updated pubspec description to surface on-device processing, iOS 17 runtime requirement, and on-demand ML Kit model download.
0.1.0 #
- Initial release of the native Flutter background-removal plugin.
- iOS implementation powered by Vision Framework
VNGenerateForegroundInstanceMaskRequest(iOS 17+). - Android implementation powered by ML Kit Subject Segmentation.
- Added
CutoutOptions.cropToSubjectfor optional subject-bound cropping. - Added
CutoutOptions.writeToCachewith file-backed PNG output enabled by default. - Added typed result models:
CutoutFileSuccess,CutoutBytesSuccess, andCutoutFailure. - Added cache cleanup via
NativeCutout.clearCache(). - Added Android model lifecycle APIs:
isModelAvailable(),downloadModel(),downloadProgress, andclearModel(). - Expanded the example app and README to cover model management, output modes, and result comparison.