Remove white background from masked image in android - android

I want to crop a bitmap in polygon shape drawn above that bitmap. I'm using masking of bitmap to do this.
The operation succeeds well, unfortunately the resulted bitmap after masking has a white background in cropped area,as you can see in the image:
And my mask that is created runtime by dragging rectangle around image and creating a polygon shape on above the image is as below :
I want to remove this unwanted white background. Does any one has idea how could I do this.
Any clue or help about how can I do is greatly appreciated.
Thanks in advance.

Related

Movable Unblur image mask in Android

I have this feature to be implemented in my app. Image is received from a remote database,
the image has a blur filter with a shape that shows unblur part of the image.
This shape/ unblur mask is so other parts of the image can be seen by dragging it.
https://stackoverflow.com/questions/14780006/transparent-blurry-view-which-blurs-layout-underneath This gave me some idea but Renderscript is depreciated and few resources which cover render script are not working
What other libraries can be used to achieve this kind of task?
unblur shape mask

How to crop when rotate bitmap without getting background as black in android

i want to crop bitmap when rotating the bitmap using seekbar if the rotation angle is 0,90,180,270 or 360 when apply cropping working fine like shown below.
but other angles like 20,45,130..etc when apply cropping getting background as black like shown below
i googled a lot but i'm failed for the solution.
how to crop the without background black or how to apply zoom to the view?
is have any idea or sample please tell me..
Thanks in advance..

Crop an image, only visible part of it, which is behind another image

I want to get the part of an image which is visible to us. There is another image over the first image. So from that image, some part of first image is visible. And I want that part only.
I’ll show you sample of it and final output which I am expecting from it.
I know how to crop in oval shape. But here, the template used in above example can be different in actual, so as per the template /mask I need to crop that image.
How can I do this. Any idea?
A simple but maybe not very efficient solution:
assume the mask is above the real image
both images are in the same container and if the mask is above the image this means that the pixels of the image would correspond to pixels of the mask
draw only those pixels of the image whose corresponding pixel in the mask is not black

How to fill the drawable region in an imageView with another drawable?

so I'm trying to find the region of the current image in the ImageView and fill that region with a different image. Here is the original image Empty Circle inside an imageView. The imageView has a drawable of a circle inside. Then I'm trying to make it into something like this Circle filled with image inside an ImageView when a user chooses an image. I don't want to manually Photoshop a circle image. I am just hoping to fill the region with another image. I have tried SRC_IN method from AlphaComposite, but for android, I can't convert from BitMap to graphics2D. If anyone knows how to solve this using the BitmapFactory in android, I would really appreciate your help. Thank you.
The other solution besides Bitmaps, may be too simple for whatever you are trying to achieve otherwise I think it would have occurred to you. I'm just pointing it out in case you have "code blindness" and are trying to over-engineer the solution because you've worked on it for too long (we've all done it)
It is to have that circle/shape image saved as a png with the area you want filled being transparent then set it as the drawable for an ImageView (etc.) then in a RelativeLayout lay this view over the image you want to fill the area and apply a transparent background to the shape view OR simply set the fill image as the background for the shape view.

How to get black shadow around the image dynamicaly?

I am working on image processing i have achieved color effect using ColorMatrix but i cant understand how to achieved one effect that is not on whole image but only around the image like i have attached image. Actually i m working on image editor app like : BeFunkey
Here original image and processed image i have attached. You can see in effect on second image that is only around the image black shadow. Please can anybody tell me how to do this. Thank you in advance.
You need to set RGB colors of you bitmaps. Have a look over android-image-filter
This demo will fulfill your requirements.

Categories

Resources