Color Banding: Bit Depth & Chroma Sampling

TL;DR If you’re seeing color banding (aka posterization, false contours, quantization noise, crappy gradients) in your exported video, it’s almost certainly because you’re using an encoding profile that specifies a color depth of 8 bits. Use a codec, such as H.265 / HVEC, DNxHR or ProRes, that supports 10 bit color and configure it to use a 10 bit encoding profile.

Banding in an 8 bit image of clouds, desaturated and contrast pushed

This 2021 post by Lewis McGregor provides an excellent walkthrough of the issue and a fix. It’s tailored to DaVinci Resolve and H.265, though totally generalizable. As of Resolve 18, you can actually encode 10 bit color with both H.264 and H.265 codecs within either a QuickTime or MP4 wrapper, as long as you select the NVIDIA encoder rather than the native one.

H.265 10 bit encoding options in DaVinci Resolve 18.0

If you’re not sure what bit depth (or even what codec) has been used to encode a particular video file, just drop it into Media Area’s very useful online checker to find out, along with realms of other helpful metadata (and enough ads to make your eyes bleed).

For a bit more technical background, here’s an outstandingly clear video explaining the differences between 8 bit, 10 bit, and 12 bit color in 3 minutes flat.

Color bit depth explained

You’d think that the 16.7 million colors available in 8 bit models would be plenty, given that the human eye can supposedly discriminate only 10 million or so. It ain’t. Color discrimination in human subjects is non-linear and highly sensitive to environmental context.

Smooth gradients between similar colors, as you typically find in an expanse of blue sky, quickly start looking horribly stripy once you increase the contrast ratio of the image.

Imagine a gradient between a lighter and a slightly darker version of the same blue hue converted to grayscale. There are only 256 luminance variations of gray in an 8 bit color model. If the gradient is crossing just 6 or 8 of those shades of gray in an image, it’s easy to see how banding can become discernible, as it does in the grayscale image at the top of this post.

Below is another really clear exposition of bit depth, with bonus material on color sampling (aka chroma subsampling) from 1:42, which explains what all the 4:4:4 / 4:2:2 type options mean on encoding profiles and configurators.

Chroma subsampling explained

Essential stuff to know if you want to understand what exactly lossy codecs lose and why this might matter.

By this point, the following table from Avid’s website distinguishing five distinct encoding profiles for the DNxHR codec should make total sense.

Avid DNxHR formats, by bit depth and color sampling

If you’re using the DNxHR format during color grading or compositing, you should probably be using either the 444 or the HQX flavor as the other three profiles are all 8 bit.

[Super-bonus postscript: Wikipedia explains how quantization errors (basically: rounding numbers up or down to a given level of precision during the digitization of analog source material) causes perceptible distortion in both visual and audio fields. In both cases, the deliberate introduction of noise to randomize the quantization errors (aka dithering) makes visible banding and audible distortion much less noticeable to the human eye and ear. This technical trick is often used in both software and hardware to reduce the appearance of color banding in 8 bit images].

Leave a comment

Your email address will not be published. Required fields are marked *