Wednesday, 10 March 2010

noise reduction

People tend to think of cameras as magic boxes, but its not just "white-mans-magic" and there are some principles of physics and engineering you can apply and which are comprehensible to 'mortals'

The first step of any digital photographer wanting to improve their image quality is to expose to the right. I'm confident that this is quite widely known and accepted now. However there is a problem that can't be fixed easily here and that is that all things are not always equal with colour temperature.

All film is rated for colour temperature (daylight is often printed on the box).

If you look at this box of velvia slide film you can see it printed on the end.

The other major group of film is tungsten balanced, meaning its good for tungesten lights (which are normally the really bright really hot ones).

Older photographers (or ones with classical training) will know to use the right film in the right location or use a filter on the camera to adjust this. For instance a Wratten 80A is used for adjusting daylight film to use in tungsten lighting.

My advice to digital photographers seeking to improve their cameras image quality by reducing noise in indoor photographs is to use this filter in those situations just as if you were using film.

Why?



Well, firstly, I'm reasonably comfortable that the sensors on the cameras are balanced for daylight. I'm also reasonably sure that white balance is not done by tuning the analog gain of B or G sensors in the array. This means that if you shoot in daylight all sensor tuning things will be at their peak, but if you shoot in other light and use AWB then the camera will "fix" for you in the data (not in the analog Analog to Digital conversion stage) the imbalance of light colours you see see as right but the camera sees as 'funny'.

so, if you set your camera to be daylight (not AWB where the camera makes some guesses as to the colour temperature) of an indoor shot you'll get something like this:


This is a snapshot of the back of my G1, notice how much better the red signal is, and how little blue there is?

Split the channels of a AWB shot from indoors and you'll see that most of the noise is in the blue channel looking at the above histogram you can see that to "normalize it" one would need to stretch that blue significantly. Depending on what happens on how your camera reports clipping, you may get the clipping warning in your display, but its only the red channel reporting causing the blinking warnings ... I'm told that's common.

When you look at the histogram of the AWB image it will look nicer than the above one, but that's been after the camera has stretched the data ... thus you'll have more noise (and probably some posterisation) in the blue which will also contribute to the overall "pepper grain noise" effect in the image.

So, if you want to expose right, and minimize noise you can either blow out the reds (recoverable to some extent in RAW post processing) or do something quite old fashioned and use a colour correction filter such as an 80A Wratten on your camera when you're indoors.

These are a deep blue and will really help your digital images (just as they did our film images years ago).

so while we've largely forgotten about colour filtration and film "colour temperature" the concept still holds importance. I'm sure if you did your test outside you'd have been happier with what you saw from the camera, and if you used the 80A on the camera inside you'd be happier than you were with the images you found.

I encourage you to split the test image into RGB in photoshop and look at each of the R G and B layers and see just how much noise there is in your blue channels.

Lets walk through a quick example without a filter... I took this last evening sitting around the on the couch with my 50mm f2.8 lens on my G1 at 1600ISO using a preset white balance in the camera for tungsten lighting. This means that the camera tries to push up the blue internally.



one could possibly squeeze a bit more out if the image looking at the picture, and perhaps that blue could be moved up a little more (and the image looks a little red too). Now, lets split the channels:

RED


skin tones look dreadful, but then this to be expected looking only at the reds. Noise seems acceptable.

GREEN
more of an "ortho-choromatic" black and white look (which was a non-red sensitive film). Hardly a flattering portrait choice, but still noise is under control.

Now, lets move onto the blue channel and have a peek...

BLUE



Totally filthy, noisy and posterised, looking like a massively under-exposed image (which it essentially is) brought up with the application of curves.

The reason for this is the same as the reasons in the much earlier article on LL about expose right, let me quote from that here:

A 12 bit image is capable of recording 4,096 (212) discrete tonal values. One would think that therefore each F/Stop of the 5 stop range would be able to record some 850 (4096 / 5) of these steps. But, alas, this is not the case. The way that it really works is that the first (brightest) stop's worth of data contains 2048 of these steps — fully half of those available.

Why? Because CCD and CMOS chips are linear devices. And, of course, each F/Stop records half of the light of the previous one, and therefore half the remaining data space available. This little table tells the tale.

Within the first F/Stop, which contains the Brightest Tones
2048 levels available
Within the second F/Stop, which contains Bright Tones
1024 levels available
Within the third F/Stop, which contains the Mid-Tones
512 levels available
Within the fourth F/Stop, which contains Dark Tones
256 levels available
Within the fifth F/Stop, which contains the Darkest Tones
128 levels available


so, if you are in the lower levels of exposure on the blue then either you'll have filth, or you'll put a CC filter on and allow more light in to the blue.

Some people argue that this results in reduction of light to the sensor. More correctly I will point out that this results in reduction of Red and Green light to the sensor but no significant reduction of blue.

It will result in a longer shutter speed, but your choices are this:
  • bring the Red and Green back to the levels of the Blue and get a better tonality
  • leave the blue under exposed and get filthy
  • try to get a faster lens (and still use a CC filter)
  • crank up ISO if possible (and still use a CC filter

If using this method saves you from chasing a more expensive camera, and a filter is about $5 then its been worth it :-)

3 comments:

Noons said...

Bingo!
Hit the nail on the head again, Chris!

Anonymous said...

Beautifully argued, supports my recent decision to purchase a Mamiya 7 (so, I'm biased).

Two little nitpicks though:

1. You mentioned of your Olympus

> While the G1 image is certainly cleaner in noise the 35mm is actually holding more details.
[deleted for brevity]
>
> Not bad from 30 year old technology!

It's not all 30 year old technology. Fujifilm has greatly improved film technology, even in the last 10 years. Their 400 ISO film now looks almost as fine-grained as their 100 ISO film used to (this is just my flawed observation, I haven't tested this properly).

2. On using floating point to represent brightness levels: I think what you are after is using more bits when processing the image rather than specifying how you represent the data.

Changing the representation will not change the fact that you only had so much resolution to start with, and won't help at all if it does not have sufficient space in the representation to avoid unnecessary rounding errors.

I think embedding your data in a representation with sufficient space (e.g. a 16 bit picture in the middle range of 32 bit integers) so you can transform the data with minimal loss of numerical accuracy is what you are after when you are actually doing things to the picture.

But the trick is definitely to do as little to your picture as possible as most transformations will cause some loss of accuracy.

obakesan said...

Hi Anonymous

I think you may have somehow joined more than one post, as the comment "Not bad from 30 year old technology!" isn't in this blog post.

Either way your right, and I am fibbing a little there. There have been some technology advances in film, but to be honest I don't really see much development (pun intended) on film capacity since the 80's or 90's, mostly its nipping around the edges of what was already a good stock.

but hey, I like film