This post is all about determining camera setting to achieve a more precise Depth of Field - in particular for those difficult Bokeh shots - where the traditional calculations just don't seem to work.

Lets start with another of my Wolfram Widgets - a traditional

**Depth of Field Calculator**- and for those who don't know the diameter of the circle of confusion for their camera all you have to do is enter your sensor type and it's worked out for you.And for completeness here is a

**Hyperfocal Distance**Calculator**.**These seem to work well for most landscape compositions. However when trying to achieve the maximum DoF (using the largest possible f-number) the edges are often a bit soft. This is often due to camera shake or Diffraction. So for those using a tripod I've created a very simple

**Diffraction Limit calculator**- it calculates the diameter of a spot created by diffraction when a point of light is projected onto the sensor.If the resulting diameter is greater than your camera's circle of confusion (this can be found in the results produced by the DoF calculator, for your sensor type) then any resulting image will be compromised by diffraction. That is a point of light will no longer be resolved to a sharp edged circle (of confusion) with diameter of approx 0.02mm on the camera's sensor. It will instead be resolved to a larger, fuzzy circle equal to the diameter calculated for the given f-number. Usually diffraction starts to become a problem at f-numbers greater than f/16.

But, if I follow all the time honoured advice on DoF, I am not always completely satisfied. If you have the same problem and in particular if you have problems applying DoF advice when creating Bokeh images read on. The problem is not your (or my) ability to follow the 'rules'; the problem lies in how we use the 'circle of confusion'.

Consider the following:

The

**Depth of Field Calculator**suggested that focusing on the card and using f/16 I would have a very narrow DoF (less than 3cm)I therefore assumed that the text on both the lens cap and on the mug in the background would be unrecognisable. So what's going on?

When a lens is focused at a certain distance, light from that part of the scene forms a point on the camera sensor. But, light from other parts of the scene, that are closer or further from the point of focus, form circles rather than points. These circles are referred to as circles of confusion.

*The closer to the point of focus the smaller these circles are and the further away they are from the point of focus the larger they are.*

Now when we talk about DoF we are saying that points of light from that region will be rendered on the sensor as circles no larger than a circle which when printed on a 10x8inch print and viewed from 3ft by someone with 20/20 vision, will appear sharp.

- On a full frame DSLR this is deemed to be a circle of diameter 0.029mm
- On an APS-C Nikon/Pentax/Sony this is deemed to be a circle of diameter 0.02mm
- etc.

However points of light from objects outside the DoF form larger circles but,..... they may still be recognisable, still 'in focus', albeit a little soft around the edges. For example consider the letter

**'N'**on the lens cap lying well outside the DoF, it's 6mm high. The letter will be rendered as a collection of white circles larger than the 'standard circle of confusion'(0.02mm on my camera), but much smaller than 6mm (actually 2.8mm - trust me for now, you'll see how this figure is calculated later). Now although each circle will overlap its quite obvious that the overall image of the letter will be recognisable. It will only become unrecognisable when points from the letter are rendered as much larger circles, (closer to 6mm).There is an alternative way of looking at DoF (see Merklinger).

We can ask the question:

*If we projected a point on the sensor back through the lens onto a screen placed at point X, (less than D the distance to the point of focus) how big would the circle be?*The answer (according to Merklinger) is

Sx = (D - X).f/D.N

where f=focal length of lens and N = f-number

Similarly for a screen placed at point Y, (greater than D) the projected circle would have diameter:

Sy = (Y - D).f/D.N

Diagram showing the 'projected' circles at X, D and Y (any object at Y smaller than the projected circle will be out of focus, larger and it will be recognisable but with soft edges) |

Using these simple equations and substituting answers from my

**DoF Calculator**, we can establish that the smallest object to be rendered sharp at the near limit of DoF is 0.122mm in diameter and at the far limit of DoF is 0.126mm. So any detail with a diameter of 6 - 8mm close to the DoF limits is clearly going to be recognisable, (even with the effects of diffraction, that cut in at f/16).I clearly need another widget that calculates the f-number required to ensure near and far objects, of a given size, are out of focus.

And here are the results for my Bokeh image:

Merklinger's equations are so simple to use and remember, and they offer such precise control over focus that I guarantee I'll be using them in future - who knows I might now even be tempted to venture into portraiture and macro photography.

The calculator suggests that any f-number less than f/5.7 will produce acceptable results |

The resulting image using f/5.6 |

Merklinger's equations are so simple to use and remember, and they offer such precise control over focus that I guarantee I'll be using them in future - who knows I might now even be tempted to venture into portraiture and macro photography.