Friday, January 21, 2011

A Few Thoughts on Banding in Images

The other day I was browsing through the APANet discussion list and came across a question from a photographer about banding issues they were seeing in the skies of some images. After responding there I thought this would be a great topic for a Blog post so here we are.



Here's a shot of the sky over Lake Powell in Arizona. Like most shots of skies this image shows a nice gradation over a large, fairly open area and is a good example of where you're most likely to run into banding issues. If you look closely there are subtle bands running in a rough diagonal direction following the gradation in the sky.

Upon first glance they don't look too bad, but as soon as we add a little drama to the sky they start to become more apparent. In the image below I darkened the upper part of the sky by adding a Curves Adjustment Layer along with a mask that has a gradation in it so the darkening eases in keeping the lower part of the sky the way it was.



Now sometimes the web isn't the best place to see these bands so here's an image with some red lines indicating where the bands are showing up.



Of course once we see the bands in the image we can see the problems they can present. We know scenes like this should have nice, smooth gradations so the steps of color we see (banding) become very distracting and threaten to ruin our image.

For the sake of our discussion let's take a look at another image. Like our sky the image below features a gradation (you'll only see banding in areas of gradation) but this time it's easier to see the banding.




The bands show up when the steps in between the colors in the gradation become visible. Basically if there are only 10 steps between the beginning and ending colors in the gradation it becomes pretty easy to see each step of the gradation if you look closely enough.

Sometimes the banding is naturally occurring in the image and sometimes the adjustments made to the image exaggerate the banding issues. For instance the Hue Saturation tool is known to exaggerate both banding and noise/grain in an image. Here is the same gradation with a Hue Saturation Adjustment Layer added to turn the grays into blues.



Here you can see that the Hue Saturation Adjustment Layer not only changed the colors, it made the banding worse! With over 24 million possible colors in a 24 bit image (8 bits/channel times 3 channels) you'd think there are more than enough to choose from.

But as we see with skies sometimes the colors the image HAS to be just don't allow for that much room. Right about here I can tell some folks are thinking "Ah, then the solution is to work in 48 bit depth!" (48 bit images have 16 bits per channel allowing for thousands of steps per channel not just the 256 found in 8 bit/channel images.)

But experience seems bound to defeat this easy solution. Every time I've tried to solve banding by working in this higher bit depth it's never made a difference. The reasons for this seem to be mired in the endless debates among computer engineers and geeks. The best explanation I've heard for this actually came from a computer engineer who used to work for one of the big software companies who told me the pipeline from the computer to the monitor was limited to 8 bits per channel.

Whatever the reason we're still left with apparent banding in our images and thus we need to figure out how to deal with it.

The first thing to look at is to see if any of your adjustments are creating the problem. The most common times this happens is when using several Adjustment Layers that push and pull the image leading to the posterization evident in the banding. Sometimes, as with the Hue Saturation example above, the tool we're using is the cause of the problem, I've also seen this happen with some Gradient Map layers as well. If that's the case then we need to find other ways of manipulating the image to get the result we want.

But luckily for the great majority of images the answer is pretty simple. If the cause of the banding is that we can see the borders between the distinct steps in the colors of the image we can usually solve the problem by breaking up those borders with a bit of Noise. Here is our same Blue Gradation image with 2% Noise added.



Here you can see how the Noise acts to dither, or break up the borders of the bands making them harder to see. The trick when adding Noise like this is to view your image in Photoshop at 100% while using the Add Noise filter. Look for the minimum amount that will break up the bands. Most often you'll find it just takes a very small amount to hide the bands and solve your problem. Checking the individual Channels in your Channels Palette can help make sure you've fixed the problem.

As a last note one of the most common ways high end retouchers like to add Noise to an image is to make a new Layer, fill it with 50% Gray and then set it's Blending Mode to Overlay and finally use the Add Noise filter on this layer. By doing it this way you can easily experiment with different amounts of Noise (just fill with 50% Gray and try again) and you can vary the opacity of the Layer, or hide parts of it with a Layer Mask etc etc.