Digital Black and White – working in 16 bit
Digital Black and White at 16 bit from 8 bit colour
When is an 8 bit file not 8 bit?
Something for nothing? – 10 bit images from 8 bit
In this short article, Keith shows how an 8 bit RGB file (such as a JPEG) can actually be the equivalent of more than 8 bits of greyscale information, when doing your conversions in Adobe Photoshop.
Could the benefits of 16 bit apply to 8 bit images as well?
This technique can have benefits if you are going to be applying many adjustment curves to your images.
As ever, any comments are welcome…
Why 8 bit RGB can be 10 bit greyscale
Lets say I have a JPEG colour photo and I want to convert it to black and white.
Now there are a number of different ways of converting colour to black and white and I covered some of the basic principles in my introduction to digital black and white article.
You would think that converting your 8 bit RGB image to 16 bit RGB before converting to B/W achieves nothing – there is no extra information.
Well it’s not quite that simple and if you want to get the best black and white images to work on, then it might be worthwhile…
In an 8 bit RGB file there is only a limited range of pixel RGB values in the shadows (or darker parts of the image). There are several factors that affect just how many you have to play with when you start applying adjustments to the data.
The sensor in your camera
– it has a linear response to light, compared to the human eye and film. This means that there is much more information for the brighter parts of the image. Sensors tend to produce at least 12 bits of data per channel. This gets reduced to fit into 8 bits for a JPEG (and compressed as well, but we’ll ignore that)
Both sRGB and Adobe 98 are gamma 2.2 spaces. The gamma means that more levels are allocated to darker parts of the picture, to allow for the eye’s increased perception of shadow detail.
If you think of the first (brightest) 5 Stops of light levels in your image, we get:
|Brightness||Number of levels in an 8 bit 2.2 gamma file|
|1st Stop (lightest)||69|
|5th Stop (darkest)||20|
Figures are from Luminous Landscape site – I’ve not calculated them exactly
Note that the figures only add up to 203, so we have levels left over for even darker parts of the image.
Consider one pixel in an 8 bit sRGB file, with RGB values of R=20 G=20, B=20 (20/20/20), it will on straight conversion (averaging the channels) to a Gamma2.2 greyscale image, give a value of Luminance (L) = 20
The difference comes with converting a value like 20/20/21 to greyscale – it will also give L=20 (I’m assuming a simple averaging conversion here – the principle holds for other conversions that make use of the different channels) So we get the same value L=20 for inputs of 20/20/21, 20/21/20 and 21/20/20.
Note. It’s important to remember that we are using integer arithmetic where 60 divided by 3 gives 20, as does 61 divided by 3
If you take the 8 bit RGB file to 16 bit RGB then:
20/20/20 goes to 5120/5120/5120 > L=5120
21/20/20 goes to 5376/5120/5120 > L=5205
That’s 2 levels of grey where in 8 bit you would only have one
With the simple averaging conversion 5376/5120/5120 gives the same as say 5120/5376/5120, but with even the basic ‘Image>Mode>Greyscale’ option you would get different L values.
With the channels mixed in the proportions 30%:60%:10% (simple ‘Image>Mode>Greyscale’) we get
20/20/20 goes to 5120/5120/5120 > L=5120
21/20/20 goes to 5376/5120/5120 > L=5197
20/21/20 goes to 5120/5376/5120 > L=5274
20/20/21 goes to 5120/5120/5376 > L=5147
That’s 4 levels of grey where in 8 bit you would have two (20/21/20 goes to L=21).
If you include the full range of values between 20/20/20 and 21/21/21. The 16 bit conversion gives 8 different L values instead of two — that’s effectively a 10 bit greyscale rather than 8 bit.
So, as you’d expect, the RGB value for a pixel that is slightly ‘greener’ comes out a bit brighter in the greyscale conversion, due to the 60% weighting for that channel.
Note, I’ve ignored the fact that Photoshop ’16 bit’ is actually signed 15 bit i.e. +-32k rather than 0-64k)
The difference comes from the fact that an 8 bit RGB file represents 24 bits of information which, depending on your choice of conversion technique, can represent more levels of greyscale that the 256 allowed in an 8 bit greyscale image.
Thus for the example in the table above, and using a simple conversion to greyscale (at 16 bit), you could get up to 80 levels of greyscale information in the 5th Stop, rather than the 20 in the 8 bit file.
So what? …
What brings this fact from an academic exercise into practical usefulness is the limited range of levels in the shadows of an 8 bit greyscale file. This means that it may not take too much adjustment to show a bit of posterisation or some other artefact in the shadows. It might show up in brighter parts of the image as well, but there are slightly more levels to use, and the eye is less sensitive to changes in the lighter parts of images.
By converting your files from RGB-8 to RGB-16 to greyscale-16 you are just getting a bit more out of the original and avoiding errors that are more likely to accumulate with 8 bit maths. I’m not aware of the actual maths used within Photoshop so the numbers above are just examples to illustrate the point. I also suspect that with many pictures, you just wouldn’t notice the difference, but if you are going to shift stuff about much in the shadows, it does help.
There is also a subtle feature in the Photoshop 16 bit -> 8 bit conversion that helps produce better looking results. It seems that a small amount of dither is introduced to help prevent banding/posterisation.
Note I’d appreciate feedback from anyone with more knowledge on how PS actually handles the conversions.
Here is a picture I took in New Mexico of some ice next to a mountain stream one morning.
It’s a reduced JPEG file from my Canon 1Ds
It’s a bit dark since I wanted to capture all the sparkling highlights from the ice and water
Here it is converted to greyscale (simple mode change in Photoshop)
A bit dark, so I’ll apply a curve
Much better, and with a bit of masking of the curve to bring back some depth to the shadows in the water, it might not look too bad.
OK, here is the curve I applied.
I applied the curve to two different versions of the original 8 bit JPEG.
One was opened normally and converted to greyscale, while the other was opened, converted to 16 bit RGB and then converted to 16 bit greyscale.
After applying the curve and flattening the image, I looked at the two histograms for the images
|8 bit image||16 bit image|
Which one would you rather carry out further work on?
It was suggested that the 16 bit one was bound to look better, since I’d applied the curve to 16 bit data
Here is the histogram from the following sequence
RGB 8 -> greyscale 8 -> greyscale 16 -> apply curve
And just to tidy it up…
Here are the histograms after the 16 bit images were converted back to 8 bit
|8 bit||16 bit|
Back in the real world…
So, there you have it, there is a difference. The only question is when to actually take notice.
As to everyday use – your mileage may vary :-)
I’ve got a raw file of the sample image which I’d have used anyway, since I do most of my black and white conversions from Raw->16 bit colour->16 bit greyscale.
I do work in 16 bit whenever possible to minimise the destructive effects of multiple adjustment layers, particularly with my black and white work.
There is also the matter of just how well your B/W printer/driver converts the data into ink on paper, many printers will introduce quite a bit of posterisation and banding on their own.
Enjoyed this article?
All the latest articles and photo news items appear on Keith's Photo blog
We've a whole section of the site devoted to Digital Black and White photography and printing. It covers all of Keith's specialist articles and reviews.
Articles below by Keith (Google's picks for matching this page)
If you start your buying of anything whatsoever from Amazon (not just what's listed) via one of our links below, it helps myself and Karen to keep the site going. We really do appreciate this - thanks