My interpretation of the non-question was this: View attachment 89516
Meaning, removing background by cropping using a bounding box. (Shown as red outline here.)
We'll see if @Matteo Granatiero adds some background (pun intended) and perhaps even a question.
In that case I will leave this thread with an ejector seat as I have nothing to contribute other than to say that as far as I know, this is an amazingly difficult problem to solve. Have fun.
There have been a few ports to OpenCV for B4A over the years. There may be a function that allows you to isolate an object within an image – I'm not sure.
As someone else posted, this seems straightforward but it is an incredibly difficult problem.
This is only for transparent background, that's why I wrote that it is only "a bit related".
BTW, the image from the first question can be handled with a similar code. As already written several times there is a huge difference between removing a solid color background and removing real world background. These are completely different tasks.
I was holding off on posting this xkcd comic as I didn't want to dilute the thread, but I feel the planets are aligning so much that I can't resist anymore: