get all colors in a pixelated image in android : i am using android studio and i want to get all colors in a pixelated image. I have a pixelated image of 50x50 size. here is that image

[![enter image description here][1]][1]  


  [1]: https://i.stack.imgur.com/xrpVo.jpg

I'm reading all pixels in it by using that code.

    Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.abc);
            for(int x=0; x<50; x++){
                for(int y=0; y<50; y++){
    
                    pixelColor = bmp.getPixel(x,y);
                    if(pixelColor == Color.BLACK) {
                        //The pixel is black
                    }
    
                    else if(pixelColor == Color.WHITE) {
                        //The pixel was white
                    }
                }
            }
But the problem is that, image has also black color in it and in my code black color condition never get true. i want to extract all colors in that image. please let me know where i'm doing wrong. Thank you.