Color Depth - EN

Clique para versão em português

To know before reading

  • Bit is the smallest unit of information that can be stored or transmitted.
  • In a easy way, a pixel is the smallest point that forms a digital image, each pixel contains information generally interpreted as color information.

Color Depth

Also known as Bit Depth it is a computer graphics term that describes the amount of bits used to represent the color of a single pixel in an image.

A high bit depth means more numbers of shades that this pixel can reach (either in gray or color scales). So the more bits present in a single pixel, the more tonal variations and precision that pixel can offer. For a grayscale image the bit depth quantifies how many unique gradations of gray are available.

To make it easier for future understanding: All the colored pixels in an image are created by combining the three primary colors: red, green and blue. Each of these primary colors can also be called as color channel and has its own range of intensity. So the Bits per Pixel (bpp) term is the total of bits present in these three color channels together , while the Bits per Channel (bpc) term is the value of bits in each of the three color channels. In 32-bit images there are 4 channels when added to the alpha channel.

24-bits and 32-bits per pixel images have the same amount of color depth, the only difference is that images with 32-bits has an extra channel called Alpha, presenting 8 more bits in this channel. The color quality here will be exactly the same, however if you are going to work with transparency, then you will need to have the Alpha channel. If you are saving a final image for viewing only,  images with more than 24-bits per pixel (or 8-bits per channel) are not necessary.

Maps like Diffuse, Specular and Glossiness usually need less bits-depth to keep their accuracy and are usually generated with 8-bits per channel. So if you are not going to edit your values or levels in an extreme way the gradient of tonal values present is enough for a great map.

An example of influence in our work when we use a very low color depth (8-bits per pixel in the example below) can be seen in the color gradation of an image, which is commonly called “banding” or “ stair-stepping ”, and can easily be corrected when the image is rendered with a higher bit depth, such as 16-bits or 24-bits per pixel. This is a common effect when we use some kind of gradient as you can see below.

 Another common problem comes when you're baking your maps. When we generate a Normal Map at 8-Bit per channel we can end up having an unwanted effect where some faces of the model can be visible, which can be easily solved by generating a new map at 16-Bit per channel. But sometimes you end up not being able to use a 16-bit map in a game workflow due to its size, so a good way to get around this would be generatinge a map at 16-bit per channel and compress it to 8-bit per channel, this way you will add a little noise on the map but that will hardly be noticed in the final result, there are many softwares that do this baking and compression process automatically, this process is called dithering.

Images above made by EarthQuake at polycount post.

But if the human eye can see approximately 10 million colors, what is the use of maps and images with high depth of color that costs a high memory usage?

Besides these maps mentioned above, at some point we will need files that can store even more information, like 16-bits per channel or 32-bits per channel, they are usually floating-poit images (we will not enter into the topic of what is a floating-point). Here the color depth does exactly the same - it defines the color accuracy - however with so many bits per channel it is possible to store a large amount of data, these images have what is called the High Dynamic Range (HDR), with information of colors darker than black and brighter than white.

At the cost of more memory using HDR, there are also the advantages, such as greater precision of units in 3D world when generating your Displacement Map, having neutral colors (gray tones) presenting greater smoothness in continuous tones and more freedom to make changes at your composition with better control at adjustments of lighting, reflections, shadow, among others, improving the possibility of corrections during the production stages.

Now that we have learned more about files with a large amount of storage in their channels we can talk about the Displacement Map. This map is a creation of an image that captures information from your high resolution model so it can be applied to your low resolution geometry. The Displacement Map changes the surface of your model (it is different from the Normal Map), making it more real but also heavier.

When generated in 8-bits the map, the Displacement Map can look good if we look at the image in a 2D way, however when we apply it in a 3D software we can notice some type of banding or other problems caused by the lack of information captured by the image. In order for the Displacement Map to capture small details of your geometry they are usually generated in 16 or 32 bits per channel, as they support negative values (having a greater range of information) and better precision for small details. 

The difference between the size of these maps is that 16-bit floating-points have less precision and less power to capture information, but they are usually half the size on disk and memory consumption for processing when compared to a 32-bits map per channel. Here it is worth the test or pipeline of each company to know which one fits you best.

I would like to thank those who made it to the end, I hope this article was useful for everyone, hope you have understood what color depth is, and now when it comes to generating your maps and saving your images you will be able to think about what is best for you on certain occasions!

If you liked it, share with your friends who may be interested in too, any questions or suggestions feel free to comment or send me in private, I will be happy to help!