
The number of different colors that an image contains is known as the color depth, which gives us an idea of the image’s quality. An image can be made by 1 or 2 colors, but the most usual is that they contain between 256 and 32 million colors. When the image contains 16 or 32 million colors it is called True color image. If the color depth is higher (more colors) the quality is better.
The memory space occupied by every pixel can tell you how many colors have an image. So, a black and white image has 2 colors (21) and is a 1 bit color image. Then, an image with 256 colors or a greyscale is an 8 bit image (28colors), and a true color image can have 24 bits.
How to know the number of colors of an image
Examples