3
$\begingroup$

If I just render the default cube it will look like this: enter image description here

It is rendered with color depth 16. I can see there are artefacts consisting of visible "line strokes" on some of the cube faces.

The bands seems to not go darker and darker, but alternates between light and dark, or is my eye fooled?

Why?

Edit

Here comes a gradient created by gimp without banding, using the same computer:

enter image description here

$\endgroup$
10
  • 1
    $\begingroup$ This is due to banding. If you are viewing that 16bit image on 10 or 12bit display, you shouldn't see any banding. But on 8bit display the banding is still there and you get rid of it by dithering. Basically just add noise to the image. $\endgroup$ Mar 2, 2017 at 18:15
  • $\begingroup$ I view the image on a modern display. $\endgroup$ Mar 2, 2017 at 18:23
  • 1
    $\begingroup$ Then the artefacts would not grow when I am scaling it :) $\endgroup$ Mar 2, 2017 at 21:41
  • 1
    $\begingroup$ After some research, I can say the viewer isn't broken. The viewer is just not displaying the image in that way I would expect in 2017 @AndersLindén. It seems to be an opengl precision issue, probably to avoid conflicts with older graphic cards or due the lack of interest implementing this properly, not sure... However, nowadys it's possible to display the image without the banding and without manually adjusting a dithering value so hopefully a developer will fix this in the near future. $\endgroup$
    – p2or
    Mar 4, 2017 at 14:44
  • 1
    $\begingroup$ Also I noticed that in most cases a dithering value of 0.85 is enough to get a clean image, but then this "generated noise" is baked into the image when saving as jpg or similar, which isn't really useful in most cases. So leaving the dithering value at 0.0, rendering as exr and adding real film grain at the end of the process is the way to go (IMO). $\endgroup$
    – p2or
    Mar 4, 2017 at 14:44

1 Answer 1

10
$\begingroup$

The artifact is called color banding and is a common occurence in computer graphics. (Most) computer monitors only have a range of 8 bit per channel. The human eye can differentiate a much greater resolution of light values, especially in dark tones.
See this less specific, but informative article.

Hence, color banding is especially visible in dark gradients. An image with a depth of 12 bit or more viewed on the according viewing device would have practically no visible banding.

Although a bit depth of 16 and higher are today's standard in computer graphics such as 32-bit floating points, which have no banding in theory (most) monitors remain in 8-bit color mode.

Most image related software "solves" this issue by adding noise to the image. This process is called dithering.

Different software manage this in different ways.

  • The gradient tool in Photoshop has a dither option. enter image description here

  • Nuke dithers gradients dynamically in the output viewer.

  • Blender has a dither slider, this allows the user to control the dithering amount manually. enter image description here

By default, Blender's dither value is at $0$. That's why you can see the color banding even if the image is rendering in 32-bit floating points. Blender will always render images in 32-bit floating point color depth. Only when you save the image, will Blender convert it to the selected bit depth of the output format.

The image you displayed has dithering already applied. When increasing the contrast we can see the noise, which GIMP added to the gradient.

enter image description here

If we increase the dither property in Blender to $1$ and render the default group, there will be no visible banding artifacts. with dither

Otherwise banding will show (dither value of $0$). with banding

Increasing the contrast afterwards can reveal the dithering noise. (Left, dither at 1; right: dither at 0) enter image description here

When should I not use dithering?

Do not save images with applied dithering when you plan on processing them further. Save them with a high bit depth (16-bit or more). Postproduction applications can then do color operations correctly and dither the image at the last step if necessary.

Example: A color correction with applied dithering noise would change the amount of noise in some parts of the image thus resulting in uneven dither, which could possibly be visible.

When should I use dithering?

Use dithering in the final step of production, where the product is created which has the chance to be viewed on an 8 bit display. (In other words all final image material.)

Additional Note

Digital movie format (obviously not DCP packages) don't support bit depths higher than 8.

$\endgroup$
5
  • 2
    $\begingroup$ Great answer, but I even can see the banding on my dreamcolor monitor... I guess the viewer is broken: i.stack.imgur.com/wg6cM.png (same image on both sides) $\endgroup$
    – p2or
    Mar 3, 2017 at 11:50
  • $\begingroup$ @Poor The dreamcolor is in AdobeRGB (10bit), the human eye should be able to recognize banding. Further, your image doesn't proove anything as it is in 8bit and [nuke added noise]8http://imgur.com/a/nE1sh). If a saved 16-bit gradient appears differently than an 8bit version in your image viewer and Blender show it same way as saved as the 8bit image the viewer must be not correct. I have no means of confirming this. $\endgroup$
    – Leander
    Mar 3, 2017 at 13:37
  • $\begingroup$ Thanks for pointing out that gimp actually dithered the output in such an informative way! $\endgroup$ Mar 3, 2017 at 15:06
  • 2
    $\begingroup$ @Duarte Thanks for the edits. I admire and appreciate the effort you put into maintaining this site! $\endgroup$
    – Leander
    Jun 18, 2020 at 14:19
  • $\begingroup$ Welcome, it is users like you posting good answers that make this worth it. Keep up the great work. $\endgroup$ Jun 18, 2020 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .