Per, comment by Rishaba. Use a color matrix. Since black is black and RGB (0,0,0,255), it is immune to reproduction. Therefore, if you multiply everything by 255 in all channels, everything will exceed the limit and get compressed to white, except for black, which will remain black.
ColorMatrix bc = new ColorMatrix(new float[] { 255, 255, 255, 0, 0, 255, 255, 255, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 1, 0, }); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(bc); paint.setColorFilter(filter);
You can use this paint to paint this bitmap only in the black filter slide of black.
Note. This is a quick and amazing trick, but it will ONLY work for black. Although it is ideal for your use and will turn this long op into something instantaneous, it actually does not match the name of the question "specific color", my algorithm works in whatever color you want as long as it is black.