简体   繁体   中英

Number of pixels in RGB image

can any one tell that ,how many number of pixels are present in RGB type of image is it height * width or height *width * channels. I want to calculate bit per pixel(bpp) of an image so i need this information.

The number of pixels is simply:

height × width

It's indepenent of whether the color of each pixel is composed from a single channel or from several channels.

If your image has three channels, eg a separte one for red, green and blue, each using an 8 bit value for each pixel, then you have to add them to get the bits per pixel ( bpp ) value. In the example, it would be:

bpp = 3 × 8bit = 24bit

But it does not affect the number of pixels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM