0

I am using below code to make an ImageView greyscale :

ColorMatrix colorMatrix = new ColorMatrix();
colorMatrix.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(colorMatrix);
imageView.setColorFilter(filter);

But I want to make it pure black and pure white, only two colors, not grey color. How can I do this ?

Obtice
  • 1,205
  • 3
  • 18
  • 44
  • checkout this https://stackoverflow.com/questions/9643603/modifying-the-color-of-an-android-drawable – Ankit Sep 14 '19 at 13:34
  • images could could have any color, but i want to map white to white and other colors to black – Obtice Sep 14 '19 at 13:56

0 Answers0