Color depth tells you how finely a pixel can describe a color, and it sets both the number of colors and the memory an image uses. The color depth calculator takes the bits per channel, the number of channels and the image size and gives the bits per pixel, the levels per channel, the number of colors, the step between two levels and the uncompressed size.
How the calculation works
- Bits per pixel = bits per channel × number of channels. A common RGB image uses 3 channels of 8 bits, so 24 bits per pixel; an alpha channel for transparency adds a fourth.
- Levels per channel = 2^(bits per channel). With 8 bits there are 256 levels, from 0 to 255.
- Number of colours = 2^(bits per channel × 3) for a colour image. The alpha channel carries transparency and does not add colours. A grayscale image has 2^(bits) shades.
- Uncompressed size = width × height × bits per pixel ÷ 8 bytes, shown here in megabytes (1 MB = 1,000,000 bytes).
Example
An 8-bit RGB image has 3 × 8 = 24 bits per pixel, 256 levels per channel and 256³ = 16,777,216 colours. Each step between two levels is 100 ÷ 255 = 0.392%. At 1,920 × 1,080 pixels the uncompressed image takes 1,920 × 1,080 × 24 ÷ 8 = 6,220,800 bytes, or 6.22 MB. Formats such as JPEG or PNG store the same image in much less space.
Why it matters
Color depth matters for photography, screen design, game graphics and video. It decides how smooth gradients look, whether a file can hold an HDR image and how much memory a screenshot or a texture uses, so it helps in choosing a file format and a capture setting.
Good to know
The count of colors is the number of codes the format can hold and not the number a screen can show, since many displays are 8-bit or use dithering. Indexed formats such as GIF use a palette and have a different structure. Compressed sizes depend on the content, so treat the raw size as an upper bound.
Related tools
The photo storage calculator estimates the disk space of a whole library and the pixel density calculator relates the pixel count of a screen to its physical size.