Why is there a difference in dithering quality when drawing in 8bpc vs 16bpc?

  • 2
  • Question
  • Updated 4 years ago
  • Answered
In an effort to produce the highest quality results, I’ve experimented with many different image modes and workflows, and observed the results so I can adjust my Photoshop process to suit.

Increased colour depth, using 16 bits per channel, has many advantages when compositing lots of layers, especially when the layers use varying levels of opacity or gradients containing different opacity stops.

However, it seems with a very simple example — a single gradient from white to black — 8 bits per channel actually looks best.

I wonder why this is. Does the Photoshop team see this as a bug or a feature? Are the team aware of the behaviour?

Here’s three examples.



By its very nature, dithering is pretty hard to see, so here’s the same example with a posterize adjustment layer added.



And the same three examples again, zoomed in a lot.



### Example 1: 8bit

This is an 8bit, 256×256 pixel document with a gradient. The dithering appears to add noise to the red, green and blue channels independently. In my opinion, this is the best looking and smoothest of the three examples.

### Example 2: 16bit, pasted into 8bit

This is the same 256×256 pixel document and gradient, but with a 16 bits per channel image mode. I then copied the document as a bitmap (select all, copy merged), created a new 256×256 pixel document that’s 8 bits per channel and pasted.

It looks like the least significant 8 bits are just being truncated and no dithering is taking place in the conversion. In my opinion, this is the worst of the three.

### Example 3: 16bit, converted

This is another 256×256 pixel document and gradient, with a 16 bits per channel image mode. The gradient shape layer was converted to a bitmap layer, then the document was converted to 8 bits per channel.

The 16 to 8 bit conversion seems to dither, adding the same noise to red, green and blue evenly.



This isn’t causing me any significant issues, but it does seem strange that the last two would produce different results, and it’s a shame that the 16 to 8 bit conversion doesn’t dither independently on the colour channels.

Just to clarify: I think the highest quality gradient Photoshop can produce (if an 8bpc file is the desired output), is by using an 8bpc document to create it.

Is this working as intended?

Disclaimer: Hopefully there’s no errors in my tests.
Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 21 Reply Likes

Posted 4 years ago

  • 2
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
Because it is supposed to: dithering in 16 bit/channel is not supposed to be the same as dithering in 8 bit/channel.
Because the data is dithered for the current bit depth, by an amount appropriate for that bit depth.

In 8 bit/channel, dithering varies by +- 1 out of 256.
In 16 bit/channel, dithering varies by +-1 out of 32769.
All such data is dithered on a per-channel basis.

If you dithered 16 bit/channel data by the same amount you dithered 8 bit/channel data - it would look better on an 8 bit display, but would look horrible on a higher bit depth display and basically remove all the quality you preserved by keeping the data in 16 bit/channel.

If you are working in 16 bit/channel, and your output is 8 bit/channel - additional dithering or noise will be needed for the output at some stage.

The conversion results depend a lot on your color settings, and the amount of dithering depends on the output bit depth.

Yes, this math is well known, and carefully planned and tested.
Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 21 Reply Likes
> In 8 bit/channel, dithering varies by +- 1 out of 256.
> In 16 bit/channel, dithering varies by +-1 out of 32769.
> All such data is dithered on a per-channel basis.

Oh, I definitely get that for the initial creation of the gradient. Makes sense and is as I’d expect.

More specifically, my questions are:

1. Why is converting a document (containing a bitmap layer) from 16bpc to 8bpc different to copy and pasting from a 16bpc to 8bpc document? I’d assume a 16bpc bitmap layer source and 8bpc destination would use the same conversion in both cases. They’re essentially the same — a 16bpc bitmap being converted to an 8bpc bitmap.

2. Why dither red, green and blue independently when drawing gradients, but dither red, green and blue with the same pattern when doing 16bpc to 8bpc document conversions?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
1) Possibly someone missed a dither flag (hardwired it to false) in the copy/paste code somewhere and it hasn't been caught in testing. Both should depend on your color settings.

2) Gradients are more complex than that, because they need to dither along the interpolation (color stop) dimension, as well as each channel when converting from higher precision to the target document precision.
Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 21 Reply Likes
Thank you for the reply.

It’s great to get direct, detailed answers from you and the team. I really appreciate it.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
You're welcome.