Banding is a visual error that happens in video or motion graphics when certain colors and gradients are not accurately displayed. Often, this is due to the level of compression in the file. It manifests as sharply delineated “bands” of slightly different colors rather than a seamless transition from one shade to the next.
The most common place for this to occur is on a motion graphic background or other large area of color, such as water or sky, which contains multiple shades of the same color.
Here’s how it happens: The compression codec being used attempts to create the smallest file size possible by limiting the number of unique colors and by repeating pixels across frames as much as possible. On a background going from dark blue to light blue, instead of using 100 different shades of blue that smoothly transition across the entire frame, it might use 30 shades of blue and divide the frame into three bands of color that roughly transition from light to dark.
Since it’s also trying to repeat pixels instead of redraw them on every frame, the problem of banding is magnified as gradients shift throughout a video. Instead of saying, “This pixel is blue on this frame, and a little less blue on this frame, and a little less blue than that on this frame,” it says, “This pixel is blue for three frames,” and simply averages the values of those three similar shades to save on space in the file.
Banding is difficult to fix, particularly when working with videos on the web, as image quality and file size are generally mutually exclusive goals. Some instances of banding can be fixed just by increasing the bit rate while rendering. This allows the software to perform less compression and maintain the integrity of the content.
You can also tweak the overall effects that are applied to an area that’s producing banding in a manner that can “force” the finished file to be less compressed. On a background with a gradient, for example, turning up the “noise” level causes the transition to happen more randomly, which makes it difficult for the compression codec to create rules that allow pixels to repeat themselves across multiple frames.
A similar technique involves overlaying a second gradient containing vastly different colors, but set to an extremely low opacity level. It doesn’t make enough of a difference to be noticed by the naked eye, but it introduces just enough additional colors to accomplish the same task of forcing the software to render pixels individually since it can’t combine the colors the way that it wants.
For the most part, banding can be eliminated using the right effects and the right compression codec, but doing so will always result in larger file sizes that take more processing power and, in online cases, more bandwidth to play back. In the end you’ll always need to weigh your quality needs against your usability needs to come up with an acceptable compromise.
Have you had issues with banding, and what steps have you taken to solve the problem? Let us know in the comments below, or tweet your response using the hashtag #mcgblog.