Home > database >  How to Mask specific region of the image and create a black background image with masked portion as
How to Mask specific region of the image and create a black background image with masked portion as

Time:11-01

I'm having an image view. I have to create a mask with white color and the non masked portion should be black color and save it as an bitmap or jpg.

Original Image Original Image

Masked Image (Needs to create like this) mask image

From the above original image I have to mask the dog and create it as a bitmap or png

CodePudding user response:

You need to make a custom view which support draw line, make custom view background be transparent. Then put that view on top the ImageView in your layout. And after drawed the mask, just save the drawing bitmap create from custom view.

  • Related