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

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  It is public domain software and is a powerful tool for the analytical dissection of digital images.  

Tuesday, March 13, 2012

Some Random Thoughts for Pi Day

Some Random Thoughts for Pi Day
Ken Osborn © 2012

Everyone at one time learned that Pi is the ratio of the circumference of a circle to its diameter and the value is 3.14 and a lot more digits following.  Is there an end to the digits and is the sequence of digits random or is it determined by some as of yet unknown formula?  And can the digits in Pi be produced by a random number generator?

I'll leave the first two questions to others, but a simple Excel program to generate random numbers can be used to produce an estimate of Pi.  Consider a circle with a diameter of 2 feet.  The radius will then be 1 foot and the area Pi square feet.  If it is enclosed inside a square, the square will have sides of 2 feet with an area of 4 square feet.   The ratio of areas of circle to square will then be Pi/4.  Suppose you now throw darts at a dart board with a diameter of 2 feet enclosed in a square.  The ratio of hits inside the board divided by the number of tosses inside the square will be the same as the ratio of areas.

Write a program to generate two sets of random numbers bounded by zero and one (0,1).  These will be the coordinates for a point to be tested.  If the distance of the ordered pair to the center is less than one it is inside the circle.  If it exceeds one it is outside the circle.  Below is a screen shot from one run of the program.  The blue line is the running estimate of Pi for the specified number of dart tosses.  The purple line is the error calculated as the difference between the estimate and value of Pi to 2 digits (3.14)

If you'd like to try estimating Pi using the program, you can at Estimating Pi Spreadsheet