| Histogram Use and Tuning
in Lunar Imaging By Tony Gondola, December 2006
|
A typical earth based lunar image is the result of a long train of steps from acquisition, processing and tuning for final presentation. If accurate control is not maintained throughout this process the resulting image will be far from optimum. This is exacerbated by the fact that most of use are working with 8 bit cameras where dynamic range is at a premium. The key to controlling all this is the ever present histogram. Most of us have seen this as readouts on digital cameras or as a mysterious function in our image processing programs. At it's most basic, a histogram is simply an XY plot of numbers of like pixels over tonal value. In other words the vertical scale of the plot represents the total number of pixels that share the same tonal value. To put this into a more familiar context take a look at the image and plot below: |
![]() |
|
The lines
connect a point on the curve with it's matching tonal level in the
image, dark tones to the left and bright tones to the right. Because most of
the pixels in a lunar image are close to a medium gray you get a hump near the middle of the
plot. This mid-tone peak is a common characteristic of lunar images and
is a very useful calibration point there we'll come back to later. Another important point to understand is how the bits and numbers of gray levels are distributed along the X axis (horizontal) of the plot as shown below:
Notice that the number of gray levels are not evenly distributed with bit depth. Fully half of the available levels fall between bit 7 and 8. The number of levels available to describe the tones in the lower bits are very few indeed. This graphic more then any other shows how very little room there is for exposure error when working in 8 bits and how quickly the image will fall apart in the lower tones if even a moderate degree of stretching is applied. |
| The All
Purpose Light Meter Any excellent lunar image demands good optics, seeing and acquisition technique. While dealing with all that it's easy to overlook tuning for proper exposure with a quick glance at the screen for a "looks about right" assessment. This can lead to a lot of problems down the road so it really pays to get it right from the beginning. This is where working with only 8 bits can be a real problem. As outlined above there are so few levels to work with on the left side (dark tonal area) of the histogram that the scope for saving an underexposed image in processing is very limited. Push it too far and you'll start to see posterization (banding) of the dark areas in your image. On the other hand, if the image is overexposed. No amount of processing will recover the bright values that are lost, they are gone forever. This loss of tonal information is called clipping and is an area where digital imaging, unlike film, is very unforgiving. Here are some examples with histograms:
|
![]() |
|
This is a classic example of shadow clipping, otherwise known as gross underexposure. Notice how the left side of the histogram curve is actually
cut off. Clearly information in the dark areas of the image is being lost.
The mid tone peak has value of something like 40 and the bulk of the
information in the image is made up of less then 90 levels of gray. Here's
what happens if you try to stretch this data enough to
create an image of normal brightness where the mid-tone peak falls closer to
the center of the plot.
The tonal scale here gets very ugly indeed. The mid tones are very flat with noticeable posterization (gaps) apparent in the left half of the histogram. This is caused by the fact that there are simply not enough gray levels in the original image to give a smooth result when stretched this far. As bad as shadow clipping is, excessive highlight clipping is even worse as the following example shows:
Note that in this case the long highlight tail on the right side of the histogram is chopped off. All data beyond that point as been cut off. In the image this corresponds to the brightly illuminated crater walls that have gone to a pure white with no detail. This type of clipping can be caused by simple over exposure at the camera. If so, no amount of processing will bring it back. It's gone forever so his type of clipping should be avoided as much as possable. It's also not uncommon to cause this effect when pushing too hard with sharpening processes that increase contrast such as wavelets or unsharp masking. If that's the case then the image can be improved by pulling back on the degree of sharpening along with the use of processes such as high pass filtering that are less damaging to the overall contrast of the image.
|
| Putting it
all together Now that we're seen what to avoid,. it's possible to come up with a general idea of what the perfect lunar histogram should look like. By defining this it's actually possible to almost completely bypass the differences between displays and focus on how close your histogram is to the ideal. If the curve is right then the image will look good on any reasonably adjusted display. Obviously there will be a large variation in the actual histogram shape from image to image but by taking a look at some benchmark images it's possible to define the general features the histogram should have. Obviously neither highlights or shadows should be clipped however you can meet that criteria and still have an image that's too dark. The critical aspect then becomes the placement of the mid-tone peak that's present in most lunar images. Let's try and find this point by looking at some well exposed images taken during the Apollo program. Here are some examples:
While it must be admitted that film as used to record the Apollo images does have a response that's a bit different from CCDs, some general trends can be seen. First of all the images are exposed so that no clipping of the highlights or the shadows is present. Note that the first two images show a leftmost peak that looks like shadow clipping but actually this is a feature that will be seen whenever large areas of black shadow or black sky background is present. The best way to avoid clipping and the resulting information loss is to use an AVI capture program that provides a live histogram or allows a quick histogram check of a single image so that the exposure can be properly tuned to avoid clipping. Another noticeable feature is the very consistent location of the mid-tone peak. In the benchmark images above this point ranges from a brightness value of 118 to 128. If your original data is well exposed (no clipping) and if your sharpening processes are under control then your final value for the mid-tone peak, if present should have a near central location as the images above. Usually this only requires as small shift in Photoshop's levels or similar control control to bring this into the proper value range with well exposed original data. If you conform that your images fit the above guidelines then they will look good on all types of displays using a wide range of settings. |