Banding in jpeg photo

This is in reply to David question on banding.

What is Color Banding?

This issue is called “color banding” and it happens when values within a gradient get pushed so much that there is no color/value in the file to actually represent the mathematical change you’ve applied with a tool in Photoshop. Basically, when this happens it means you are hitting the boundaries of your file. So, every time you see banding happening, you know you have pushed too far. But you need to push things that far to get the desired result, otherwise you wouldn’t have been doing it in the first place, right? So, the next step is to see how this could’ve been avoided and how you can get the most out of your file.

How to Avoid Color Banding

The first and the most important step in making sure you won’t face this banding issue is to not push values too much during post-processing. And this means getting as much as you can “right” during your photography. Obviously, the best thing to do is shoot uncompressed RAW and nail the exposure. And for the cases when there’s too much dynamic contrast in the scene, bracket your shots, so that during the post-processing you can use additional exposures to suit your creative vision, instead of pushing the highlight or shadow sliders to 100% values. Following these recommendations alone will ensure you’ll hardly ever encounter color banding again. But that’s not all…

Next, perform as many of your adjustments as possible in the RAW file in a raw converter (etc. Adobe Lightroom, Capture One) including plug-in adjustments before bringing it as TIFF into Photoshop. It will render better results this way as RAW files have much more information and values are unclamped. This workflow delivers better results even with external plug-ins that require you to export file as TIFF, such as NIK Collection for example. I’m not sure why Lightroom + stand alone plugin renders a better result than plug-in ran from within the Photoshop but I have a theory.

My theory why you get more out of your photos with Lightroom + NIK Collection than PS + NIK

When it comes to photo file values there is not only bit depth but also dynamic range. Some file formats support only 8-bit, others do 16-bit and some support 32-bit. Then there is floating point and integer file formats and that’s where all this becomes unpleasantly complicated.

Basically bit depth is the number of colors/values you have at your disposal. Integer file formats clamp values at 0 (black) and at 1 (white). No additional information is being stored (as in JPEG). Floating point file formats save the additional information captured by the camera going above 1 and below 0 to play around with. TIFF is a complicated file format that can be both 16-bit half float (half precision floating point) and 16-bit integer. As soon as you import a 16-bit file into PS it will be integer, not a floating point. My theory is that PS can only do 16-bit TIFFs as an integer format and therefore clamps values. But as soon as you use a true 32-bit Full Float EXR or HDR file you have full dynamic range in PS, but lose the ability to use most tools and adjustments that make Photoshop so great… Also neither LR nor Capture One Pro have an option to export as 32-bit, sadly.

That would force PS to load it in 32-bit mode and preserve the floating point “status”.

So, I think the difference and degrading in an image’s dynamic range are due to a limitation in PS. Color Efex Pro might be able to work with 16-bit half float as well as Lightroom while PS cannot. And once you’ve taken away values (by opening your file in Photoshop) you can’t add them back into the file and when you try to push too hard you get banding.

This all is only a theory and I doubt a NIK or an Adobe developer will shed some light into this but if someone knows more about this I am happy to learn.

And lastly, when at the last stage you can export from a RAW converter to Photoshop, use the uncompressed TIFF file with the widest color space – ProPhoto. This will give you the maximum flexibility with Photoshop.

“Well, all this advice is great, but what do I do with files that I already have” – you might ask – “how do I fix those?” We’ll get into this in a minute, but first let’s talk about how to know for sure if color banding is there or not.

How to Fix Color Banding

While it’s best to avoid the issue altogether and think about it at the moment of capture, we all understand that sometimes you make a mistake in the field or you already have some archived files with no additional exposures. But you still want the results from those files that would suit your creative vision, right? So, there is a way to mitigate color banding even if it has already happened. In fact, there are two:

Method One: For 16-bit Files

So, if the file you’ve encountered banding issue with is a 16-bit file, the only way to fix it is to add noise. Here’s how do it most effectively:Create a new Overlay layer filled with 50% gray by clicking Control+Shift+N and setting mode to Overlay and checking “Fill with Overlay-neutral color (50% gray).

  1. Add noise to this overlay layer by selecting Filter => Noise => Add Noise. Make sure that distribution is set to Gaussian and the amount of noise needed will depend on how severe the banding in your particular image is, but usually it’s in the range of 1-5%. It’s very easy to see how much noise is needed with Solar Curve applied. Mask out this Overlay layer from the image parts that didn’t have banding issues, so it’s completely noise free.

Method Two: Best For 8-bit Files

If your file is 8-bit, there’s a more effective way to mitigate banding then by adding noise. As a nice bonus, it will also keep your image cleaner.

  1. Select the part of the image that suffers from banding. If it’s sky, the easiest way is probably to use a Magic Wand.
  2. Make a new layer from that selection by pressing Control+J, make any other layers invisible and lock transparent pixels on our newly created layer by clicking the appropriate icon in Layers pallet
  3. At this point you can turn our solar curve adjustment layer back on to better see banding, if you wish. Now, even though it might be somewhat counter-intuitive, go to Filter => Filter Gallery. Now go into Brush Strokes group and select Spatter. You’ll need to adjust Spray Radius so it’s very high, maybe all the way to max value of 25 and Smoothness all the way down to 1. Now hit OK.
  4. Now you can see your banding has dissipated and now you can turn back all the layers you need. Sometimes, if your image has very bright objects next to the problematic area, you might notice some bright speckles picked up on banding reduction layer. You can fix this by simply masking those off.

There it is, we just learned everything there is about color banding and how to fix it. Hope you found this information useful and it helped you achieve the result you were after.

This guest post was contributed by Denis Protopopov.

I hope this helps.

1 Like

Very interesting, Peter – thanks!

I haven’t used the Nik Suite from LR, only from PS. But I learned long ago that if I want to do a gradient darkening on a sky that I need to do it in LR, where I have more bit depth, to avoid banding. I’ll have to pay more attention to any banding I might get from the Nik filters and explore whether it is less using the filter from LR rather than from PS, but it certainly makes sense from his theory. I guess I rarely push things that far in PS with the Nik filters.

I have a question, though, about the advice to open in PS in Pro Photo because it has a wider color gamut. That is true, but that isn’t the same as a higher bit depth, and I have always thought it was stretching bit depth beyond the values available that contributed to banding. (As in darkening an almost evenly-toned sky with a gradient.) It certainly sounds like he knows what he is talking about. I’ll have to try this!

Other thoughts out there??

HI Diane
I only have DXO Photo Lab and the Nik Collection, so I a can not comment on what happens in Lightroom & PS. Denis point about adding noise made sense to me.

Photoshop has Neural Filter to remove JPG artifacts. I have found it to be hit or miss, but easy to try quickly. Also, for relatively smooth areas, like sky, maybe a slight Gausian Blur might help.

A blur won’t help – the problem is there are not enough tonal steps available to cover the range so they get spread out with visible differences between them and no way to fill in the missing levels. The histogram will have separated spikes like a comb. Creating noise makes them less noticeable. I haven’t used the Neural Filter – I’ll have to have a look at it.

Nice recap, Peter. Thanks for pulling that together.

Excellent! Thanks Peter