| [BOTTOM of Page] |
| Please post comments to Usenet news, in rec.photo.digital.slr-systems |
The subject of noise in digital images confuses many photographers, apparently due in part to misunderstandings about what "noise" is, but also because the distinction between a "digital signal" and an "analog signal" is not well understood, nor is the process of quantization that converts an analog signal to digital. This tutorial is designed to help with some of the biggest misconceptions about what image "noise" is and how it is visualized in a digital image. Perspective gained from this discusion and the example images allows a better informed reader to understand more from other complex and exhaustive explanations that do not begin by providing perspective. |
A Gradient The first image is just a relatively smooth gradient that progresses from a brightness value of 00 on the left to a value of 255 on the right. There is not really much significance to this image. It's purpose is only to recognize that it is a gradient we are starting with... (And if you look carefully, the fact that it is an 8-bit gamma corrected JPEG image format may be obvious because there actually is some banding visible in the darker part on the left. The original gradient image was in fact generated in a 16 bit format, and would not show that banding, but not all web browsers are able to display it either, so the 8 bit JPEG will have to suffice. Just imagine it actually is totally smooth... :-) |
|
|
A digital picture of the gradient Now lets imagine a few more things, this time about how the next series of images was produced. In fact, they were generated with an image editor, but lets assume instead that I have acquired a "perfect" digital camera... and that I pinned a print of the above gradient up on the wall and took a picture of it in low light. The light is so low that my camera with a 16-bit Analog-to-Digital-Converter (ADC) just happens to convert the sensor's signal on the brightest part of the image, on the right side, to a value of 15. That means the total range of values in the gradient will be represented in the range of values from 0 to 15, or a total of 16 values (using only the lower 4 bits of the 16 bit digital image data). What will it look like? Something like below without the green lines. And do note this is a "perfect" camera, as it has no visibile "noise". Right? (Wrong...) I've boxed, in green, each segment that the camera would have encoded as a distinct brightness level. The levels range from pure black with a value of 00 on the left, to just barely above black at a value of 15 on the right. (On most monitors it will probably appear totally black.) |
![]() |
A Post Processed Image The image above is almost totally black. But of course since the camera is "perfect" there is no grainy noise, and with post processing magic it is possible to adjust contrast and brightness of an image, and we can have a perfect picture of the gradient... almost. The next image shows just such post processing. With brightness, contrast, and gamma adjusted to evenly spread that image out across the range from 00 to 255. |
![]() |
Posterization from Quantization The first thing that is apparent is we do not have a nice smooth gradient from black to white, the way the original scene does. Because it was recorded in the lower 4 bits, with only 16 levels, we have instead 16 discrete bands of brightness value. Note too that post processing to move it to a place in the brightness range where it is visible did not change in any way the number of brightness levels. What we have is exactly the posterizaton that came from the camera's ADC, not posterization that the post-processing added. (Not that reducing the number of levels could not be done, just that it does not necessarily happen, which is an important point.) Here is an identical image with the values for each band of brightness marked in hexadecimal. What we are looking at is commonly referred to as "posterization", where each band is shown as a single value rather than the gradual range from dark to bright that it was in the original scene. The cause is technically called "quantization distortion". If we were to adjust the brightness and contrast just right for any one of those bands such that in the exact center of the band the value is the same as that exact same location on the original gradient, we could graph the difference in values between the two from the dark edge to the light edge. "Posterization" is a visualization of quantization. |
![]() |
Graphic Data Below is a graph showing the three significant signals that make up the above image. The original analog signal is in green and the resulting digital signal is in blue. In red at the bottom is the difference between those two signals, which is the error in the digital signal that was not in the analog signal.
|
|
![]() |
Since the error signal is uniquely a function of the input level to the ADC, and has no randomness, it is called a distortion rather than a noise. In theory the error signal is known at the ADC input, and hence could be sent to the output via a separate channel, and if subtracted from the output signal would regenerate a perfect replica of the original analog signal. While I've said we have a perfect camera, with a perfect ADC... lets consider what other errors might appear in the ADC in a real camera. First, the quantizer is not always dead on, and any given step might be off by one bit. That would delete or duplicate a step, depending on direction of the error. Another noise would be "clock jitter", where the timing circuits do not make each step happen at the precise time where it should. That can result in the sample being taken at the wrong time, and therefore having a value that is not correct, and it will either lengthen or shorten the horizontal portion of a step. All of those errors would be noise rather than distortion. There are also other distortion errors too. Notice that the quantization error signal potentially has a very steep rise or fall time between any two samples. It is possible that such a rise time will introduce components that have a frequency greater than 1/2 the sampling rate, and if that happens an alias signal will be produced at a frequency an equal amount lower than 1/2 the sampling rate. Such frequency components may suffer other distortions too, due to being beyond the design bandwidth. Summary
If we summarize the significant information above, we have:
Quantization is probably much greater than the other forms of noise and distortion in the ADC. Other noise in real cameras In real cameras of course there are sources of noise other than the ADC too, and it would be virtually impossible to get an image that clean in light that low. Other sources of information generally go into great details about "photon noise" and "read noise", and that need not be repeated here. But it is important to get a perspective on this business of what NOISE actually is and, in addition to that, what it looks like and how different types of noise can interact. Note that all of the above images displayed a very significant amount of quantization distortion, yet nothing was fuzzy, no hot pixels or dark pixels were part of that, it is not grainy, and each tonal area looked very clean. It just was not the exact value it was supposed to be! That is all the noise did, make it the wrong level (and not in a necessarily ugly way either). "Noise" does not necessarily present as "grainy". But now lets consider a few characteristics of the grainy noise that will virtually always accompany quantization distortion in the lower 16 levels of an image. Sometimes referred to as the "noise floor", it is usually made up of "read noise" from the sensor, but will include also noise from analog amplifiers or other sources. And the types of noise listed above for the ADC will also appear to be part of the total noise of this type. It generally will be right at the lowest level the camera can record, and will increase with higher amplifier gain to achieve a higher ISO. Generally this noise is "white noise", being very random. That is, it has a Gaussian distribution. A Gaussian distribution has interesting characteristics, one of which is that the peaks will be approximately 12.5 dB above the mean average. And therefore some of the levels will also be about 12.5 dB below the mean average, giving a 25 dB spread. That is important in recognizing how such noise will affect various details in an image, including quantization distortion. One effect of adding a Gaussian noise to an image with quantization distortion is to mask some of the that distortion. Below is an example. This is our previously "noiseless" image with 16 levels of brightness. I've added 20% random noise. |
|
![]() |
Dithering with Noise The next image is as with the above, but with 60% noise added. Keep in mind that the actual value of the noise is not of much significance, but noise value compared to the desired signal variation, in this case size of each quantization step, is important. When viewing this particular image, and the others that follow, remember that 100% noise refers to a noise with peak values that equal the total signal range, which is much larger than each quantization step size. There are (at least) two uncertainties of significance in this demonstration that make "calibration" difficult (or impossible). One is that the random noise is being added after quantization, and in a real camera the noise is also quantized. The other is that I have not bothered to work out the stated 12.5 dB peak to average ratio, and instead am appling a noise that ranges from a minimum value of black to a maximum value that is the stated percentage. The exact level of effect would happen at different numbers if it were done precisely, but there would be no change in what the effects are, hence "close enough" is "good enough", but do be aware that the percentages are entirely aribitrary. At 60% we have a rather interesting affect! The gradient has been restored! With granularity equal to that of the random noise as opposed to that of the quantization distortion, we now basically see a "smoothed", though grainy, change from dark to light. It isn't necessarily pretty, the tonal areas are not pure like they were with quantization distortion, but there is a gradient. There is also the granularity that most people associate with the concept of "noise". A major point to be aware of though, is that through all of that random noise, which is much larger than the steps between quantization levels, we can indeed still just barely see those quantization levels. |
![]() |
Not Dithered with Noise Why is it important that we can see the quantization distortion buried so deep in random noise? Well, here is another image this time also with 60% random noise added. But this image has only two quantized levels, one at 0 and one 255. Obviously the same amount of random noise did not affect this image in the same way as the previous image.
|
![]() |
Still Posterized
And here is one more, also with 60% random noise added to two levels of quantization, but this time the two levels are at 85 (0x55) and 170 (0xaa). Perhaps not any more effective at hiding the quantization distortion than when the levels were even farther apart, because obviously distance is just as important as the levels of either the posterized signal or the dithering noise. |
|
![]() |
Just Noise... This image has the same two posterized levels as above, but has 100% random noise added. The point to grasp here is that the posterization, which while relatively great, is still visible beneath an astounding amount of random noise. The reason is because random noise has a peak-to-average power of the 12.5 dB mentioned earlier, which provides our eyes with about 25 dB of "window" to see other detail. (Keeping in mind that I'm not at all certain this particular example is exactly at 25 dB, and it may actually be more or less.) Which is a very useful thing to know when looking at graphs and descriptions of noise, percentages, and using terms like "masking". |
![]() |
What is important here? At least a couple of common misconceptions about "noise" should now be in much better perspective.    1) Noise is not necessarily "grainy" looking, it can be just the wrong value.    2) A noise that is greater than a signal or greater than another noise does NOT necessarily eliminate, totally mask, or hide the lower level signal or noise. Sometimes a combination can actually improve the visual appearance of parts of an image.
|
| Please post comments to Usenet news, in rec.photo.digital.slr-systems |
| [TOP of Page] |