We’ve all been there: you sit on a picture forever, bored of retouching, and then when you do get around to it strange things start to show up in it. Like odd rings of graduated color.
These rings of color are called banding. They are nothing more than tonal breaks but before I explain where these obvious changes in tone come from–and how to avoid them–let me show you an example:
If you look at the background on the right-hand side of the image you can see what resembles a staircase of brightness, getting darker as it moves away from the model. That’s banding.
How is banding created?
Banding is easy to explain: if there are more pixels than there are brightness levels, you get banding.
Let’s take a look at how a picture is put together. We have three channels: red, green and blue. Each of these channels, which makes up a color image, has up to 256 levels. Multiply 256 * 256 * 256 and you have your total number of possible different pixel values. By different pixel values we mean that they differ in luminance, hue, or color saturation.
In our example we have the same value for all three channels because it is a black and white picture. That means there are only 256 values available.
The first dot (the bright one in the middle of the picture) has an RGB value of 78; the second dot has an RGB value of 28. The distance between them is 452px. If you were to assess it in purely mathematical terms there are 50 steps to 450px, which means that every 9px the value should change by one step. In theory that should be a clean process with invisible levels. But it isn’t.
During the editing process, information was pushed back and forth, making the image appear a bit darker here and a little lighter there. This creates holes in the histogram and changes the background’s appearance.
With a tonal correction I enlarged the area in question and marked the holes. This makes it more visible:
These holes are breaks in the tonal values and they show up as uneven progressions in colour (or lightness and darkness) in the photo.
Banding as a result of compression
To understand why banding can happen when uploading to the web, you have to take a brief look at the JPEG algorithm. How are pictures compressed?
- Compression by conversion to the YCbCr color model
The image is not saved as RGB channels (red-green-blue) but as Y-Cb-Cr (luminance, blue-yellow, red-green). While the luminance channel is stored in full resolution, the other two aren’t. They are smaller.
This series of images illustrates it:
The RGB image is broken down into a 100% version of the luminance (Y), and a scaled version for each of the red-green color information (Cb) and the blue-yellow information (Cr). This process saves a lot of data and at the same time still looks very good–except for the banding, that is.
* Note: The process is much more complex. If you would like to examine it in more detail here is some more detailed information. Otherwise, we’d rather not bore you with issues of subsampling and the like.
Next, these three channels are split into blocks–typically 8×8 pixels at first. These blocks are then smoothed a bit, which means that the tonal differences within the blocks are reduced further. When the image is saved, it won’t be the absolute values that are saved, but the differences between present and previous values. It’s all very neat and saves on data.
This saved image will be much smaller. If you want to see the efficiency of the process, just compare an uncompressed TIF against a JPG and look at the file size.
However, this block formation and smoothing creates yet more holes in our color gradient–and this makes the banding stronger. The higher the compression, the more banding.
I could go on writing for hours, but when it comes to toning, the strongest factors that affect it are: the decomposition and different scaling, blocking, and pixel-to-tone ratio.
All of this means that we can make an interesting observation about cameras: The higher the resolution and the better the noise performance, the greater the tendency for banding.
What can you do to prevent banding?
When you start to edit a picture you will be able to see during the Raw conversion process if the image might be prone to banding. If large, smooth gradients appear this is your cue to edit in 16-bit.
If you opt for 16-bit, instead of the 256 values per channel, a whopping 65,536 possible values are available to you. During editing, therefore, no holes should make their way into the histogram.
Before saving your image as a JPG, you can prevent the appearance of blooming by introducing a little noise. By ‘noise’ I mean greater difference between the pixels.
Here, we compare an 8 × 8 pixel area before and after adding noise:
As you can see, the individual pixels are now different which means that smoothing will be less successful here – the JPG algorithm has been outsmarted.
The best way to create enough noise is to create a new layer and fill it with 50% gray using “Edit -> Fill”. Now by going to “Filter -> Noise -> Add Noise” you will generate some noise. Next set the new layer to the “soft light” layer mode and vary the thickness via the layer transparency. It is important, of course, to create this sort of noise at the very end of your workflow–first zoom out, then sharpen, then add noise. If you change the order, you either sharpen (and amplify) the noise or you prevent the noise by reducing it. So do it at the very end, just before saving.
How to remove banding?
If you want to remove the banding in an already saved picture it is a relatively simple process.
First, convert the image into 16-bit to give yourself more latitude in the tonal values.
Then, remove the appearance of banding using Gaussian Blur. This will help to close the holes in the histogram.
Finally you will save the image, as described above. But it’s definitely better to pay attention during the Raw conversion process to the color depth and make use of some large, soft brushes!