Search This Blog by Google

Search This Blog

Welcome to Dijemeric Visualizations

Where photography and mathematics intersect with some photography, some math, some math of photography, and an occasional tutorial.

Total Pageviews

Showing posts with label histograms. Show all posts
Showing posts with label histograms. Show all posts

Friday, November 30, 2012

Histogram Basics


Histogram Basics for Photographers
© Ken Osborn 2012
kozborn@sbcglobal.net

Light meter?  Isn’t that something like a sliderule?  A few photographers still use light meters but most of us depend on the histogram to tell us if an image is over or under exposed.  And some know about histograms but don’t use them because they rely on the camera to make all of the photographic decisions.  Nothing wrong with that if you have no desire or need for creative control, but if you’d like to go the next step and not let the camera make all the decisions, then this little tutorial is for you.


A histogram plots light received by the camera’s sensor with light value the horizontal axis and number of pixels on the vertical axis as in the plot below.

Light values for 8 bit pixels range from 0 (no light) to 255 (blown out highlight).  The next chart shows light value assignments and the relationship to the Adams Zone System numbers.  This makes for a total of 256X256X256 color shades when the Red, Green, and Blue (RGB) channels are combined for full color.  Our eyes can see more shades of color than that but it’s close enough and many color printers can’t do any better.


So how do you use a histogram for proper exposure?

Below is a properly exposed photo shot at sunset.  There are no blown out highlights or blocked up shadows.

Abandoned Building at Sunset

Now compare to the badly overexposed image below.



Here is the same photo with the histogram superimposed.


Note that the histogram is pushed to the right with no space on the right side: the highlights are blown.

An underexposed version of the same scene.

Perhaps you want that nighttime look.  That’s good and exactly why you want control over your shot.  Before you look at the histogram below, what will the curve look like?


Of course you knew the curve would be pushed to the left with the shadows blocked, yes?

So what does a ‘proper’ histogram look like?  If you don’t want blocked shadows or blown highlights, then you will want a histogram that has nothing extending to the edges, as in the next image.  





So that’s it. Properly exposed, a photograph should have neither blocked shadows nor blown highlights.  Shadow areas that are too dark have no detail and generally lack interest.  Highlights that are blown also have no detail and are usually distracting to the central features of the image.

And now you know what happens to the histogram if the shadows are too dark or the highlights are too bright.  Of course that is not to say that the artist’s intention was not have shadows without detail or highlights that dazzled the eyes.  After all, photography is an art.  



Saturday, March 24, 2012

Digital Noise and Photography

Digital Noise and Photography
Ken Osborn © 2012

Want perfect photos?  Not possible.  Why?  Well, even the most proficient photographer with the most perfect equipment must contend with noise in the image.  It does not matter whether the image has a full tonal range from  highlights to shadows, is low in contrast, is shot with low ISO or high ISO.  There will always be noise.

The more important question is how do we get acceptable control of noise in our images?  For starters, use a low ISO setting.  This will depend on available light, lens speed, motion in the subject, and whether you are using a tripod.  If, for example, you are shooting a dance scene under low light without a flash and no tripod, you will probably have to use a fairly high ISO.  Accept the inevitable noise.  If you are shooting a landscape with the camera on a tripod, then you can use a very low ISO.  There will be considerably less noise, but it will still be there.

Figure 1 shows Steps 2 and 14 from a Kodak Gray Scale.  The photograph was shot with a Pentax K5 at ISO 100.  The extreme pixel values of each histogram for Steps 2 and 14 were used to create smaller boxes that were then inserted into the corresponding Gray Scale images.


Figure 1  Kodak Gray Scale Noise Comparison

Can you count the number of small boxes in the Kodak Gray Step 2 ISO 100 image?  Including the box in the lower right with the black outline, you should see a total of 6.  Now count the boxes in the Kodak Gray Step 14 ISO 100 image.  Including the box in the lower left with the white outline, you should see a total of seven.  You don't see them?  Look at figure 2 then, which is the same as Figure 1 but with the exposure increased in Photoshop.  

Figure 2  Kodak Gray Scale Images Plus 2EV


So even at ISO 100, there is noise.  Also, the noise is equally important in both the highlights and the shadows.  In this particular instance, it appears that the noise impacts the highlights even more than it impacts the shadows.  Another lesson is that when you open the shadows, the noise becomes more noticeable.  Could that also be true for the highlights?  If you make them darker, could the noise become more troublesome?  Look at Figure 3.

Figure 3  Kodak Gray Scale Images Minus 2EV


The small boxes now stand out a bit more and the background is even more mottled than in Figure 1.  Lightening the shadows and darkening the highlights will accentuate the noise.  

Figure 4 is an animation showing what happens when the shadows are 'opened' by increasing the exposure in curves and the highlights are darkened by decreasing the exposure.  If the individual slides were not captioned, could you tell which of the 'auto curves' slides was for the highlights and which was for the shadows?  

I'll end this post with the observation that digital noise is not necessarily all that bad.  At one time Tri-X film was considered a last resort for the desperate and today we look at those old photos with lots of grain as art!  So maybe we shouldn't call it noise but call it digital grain.  

Credit line: the histograms used in generating the animation were produced using ImageJ from http://imagejdocu.tudor.lu/.  It is public domain software and is a powerful tool for the analytical dissection of digital images.