How to get Number of bands from a Bitmap in Android Device?

136 Views Asked by At

I am doing an Image Processing algorithm using BoofCV in Android Client. For this, I did a demo on the server side using BufferedImage.

For that, my code was:

int numBands = bufferedImage.getRaster().getNumBands()

Now, I need to get the number of bands from a Bitmap Image.

Can anyone tell me how I can do this?

Thanks in advance!!

1

There are 1 best solutions below

0
Harald K On

As far as I understand, there is no concept directly equal to "bands" in Android Bitmaps.

You can look at the Bitmap.Config to get some idea of the pixel layout and how colors are stored. I believe ARGB_8888 is the most common one.