1

I want to implement a functionality where user can capture image through camera and remove the solid background (green/blue). I have already used chroma key inorder to remove background but it is not upto the mark.Chroma key removing image color also and image quality is disturbed. I have searched a lot to get better option but couldn't find it.If any one has idea to remove background color please share with us. Thanks in advance.

Umesh
  • 1,609
  • 1
  • 17
  • 28

1 Answers1

1

This is very simple, and here is a example for image view to get pixels from image and inside if condition you can replace any pixel with a transparent pixel.

Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
int pixel = bitmap.getPixel(x,y);
int redValue = Color.red(pixel);
int blueValue = Color.blue(pixel);
int greenValue = Color.green(pixel);
if(pixel == Color.RED){
    textViewCol.setText("It is RED");
}

Also use a for loop to iterate over the entire bitmap.

Michaël
  • 3,679
  • 7
  • 39
  • 64
Ali Imran
  • 8,927
  • 3
  • 39
  • 50