How to remove background image at runtime in iPhone sdk

enter image description here

I have an image in a UIImageView. These images typically contain clothing or accessories taken from the camera on a plain background. Now I have to provide users with functionality so that they can remove the background from the actual image that is being displayed. Something like the one shown in the picture here. As you move the slider, the background will begin to move more and more. Something like an โ€œinstant alphaโ€ brush in the Preview app available on Mac OS X. I want to do this in my own iPhone app.

I know that this will require some kind of image processing algorithm. Does anyone have something useful that I can reference or use to do this? Thank you so much in advance.

+6
source share
1 answer

You can display your image in some context, than change all the points that you need to the color you need, get the image from the context and display it again. This link should help you get the color of the pixel in context. Note that this method is too slow, so I think you should remember all the pixel positions that you need to change to make your application a little faster.

+1
source

Source: https://habr.com/ru/post/904590/


All Articles