Namastey,
I want to change those black color pixels to transparent pixels in a bitmap. my bitmap looks like below image.
I have tried to change those black pixels by below code. but it's not working for me.
int [] allpixels = new int [maskImage.getHeight()*maskImage.getWidth()];
maskImage.getPixels(allpixels, 0, maskImage.getWidth(), 0, 0, maskImage.getWidth(), maskImage.getHeight());
for(int i = 0; i < allpixels.length; i++){
if(allpixels[i] == Color.BLACK){
allpixels[i] = Color.TRANSPARENT;
}
}
maskImage.setPixels(allpixels, 0, maskImage.getWidth(), 0, 0, maskImage.getWidth(), maskImage.getHeight());
is it possible to do so? if yes, how can i do that?