[PAID] ImageSegmentation: Remove background from Image using AI ($8 or INR 551) 

 ImageSegmentation Extension

With ImageSegmenation extension you can easily remove background from an Image using AI which ensures results will be quite good. You might feel sometimes results are not completely accurate but then it’s limitation of lite model running on Android. It works completely offline without requirement of Internet or any API.

1. Overview

LatestVersion: 1
Released:  Today
Last Updated:  Today
Min SDK: 21
Permissions: READ_MEDIA_IMAGES (not required if you use Activity Starter to pick images)

Aix Size: 1.1 mb

Key Features:

  • Easy Integration: Simple and easy to understand extension blocks
  • High Accuracy: Utilizes advanced machine learning models to accurately distinguish between the person/s (or objects) and the background.
  • Customizable Output: Offers flexibility in output image quality and you can customize confidence threshold of Segmenter to avoid losing too much details or vice-versa.
  • Optimized for Performance: Optimized to run efficiently on mobile devices, balancing performance and battery consumption.
  • Offline Capability: Can run locally on the device, without needing an internet connection.

2. Blocks

3. Documentation

Events

BackgroundRemovedEvent raised after getting output image path. It is a temp file so it will be deleted as soon as user closes app.
imagePath | text
ErrorOccurredEvent raised when any error occurs.
errorMsg | text

Methods

IsInitializedReturns whether Image Segmenter has been initialized or not
InitializeInitialize Image Segmenter with provided confidence threshold. A pixel having confidence less than this value will be removed from foreground. Default value is 0.5, however it is recommended to keep it between 0.5 and 0.8 to avoid losing image details.
confidenceThreshold | number
ProcessImageProcess input image (can be Image component, file path or content uri) to remove background from it
image | any
ReleaseCloses Image Segmenter and releases acquired resources.

Properties

OutputQualitySets output image quality. Default value is 100.
Property Type : write-only
Accepts : number

4. Example Usage

FIrst Initialize Image Segmenter with appropriate confidence threshold1.0 means only pixels with very high probability of being foreground will be included in final image. This value will lose a lot of required details in image.
0.1 means pixels with low probablity will also be included in foreground so it may produce highly inaccurate results.
So choose something median value like 0.5.

Now if initialization was successful then proceed to process input image.
I’ll use Activity Starter to pick image and then show on Image component.

After background is removed from image, it is saved to a temp file which will be deleted once user exits app.
Processing time depends upon image quality and size.

Release Segmenter once your job is done.

Not mandatory, but as a good practice.

5. Samples and Demo

Original ImageBackground Removed

Demo Video:

6. Inject Native libs to APK/AAB

You’ll get these 2 folders:

4 native libs are located in lib folder:

but only arm64-v8a and armeabi-v7a are required to run apk on real devices.
Remaining two are required to run apk on Emulators.
The video given below demonstrates how to add native libs to apk:

A simple apk after injection (all libs) may become ~24mb

7. Purchase Extension

Thank you.
Hope it helps!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments