Incense

by Bart Arondson

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

How do you have both the background and foreground in the image in focus at the same time?

Last week I was attempting a shot where I had the back of a hat in focus and in the distance you could see a mountain. I wanted both in focus, but could either focus on the mountain or the hat. I ended up taking the in-focus shots of both and merging them in Photoshop. While that isn't difficult I would prefer to shoot the shot as accurate as possible. From what I have read aperture is important in the depth of field but what are the techniques for keeping both the background and foreground in focus?

I am using a Nikon D5100 with a 18-55mm f/3.5-5.6 (standard kit lens) and a 55-200mm f/4.5-5.6.

This question almost answers my question, but I am a bit confused. Can someone explain this a bit differently? Thanks!

share|improve this question
1  
    
@Instantkamera - Thanks for those links, I missed them when searching. Those almost answer my question but I am a bit confused. See my edit to question. –  Lynda Apr 10 '12 at 2:53
    
Small aperture - say around f/22. Smaller may work BUT diffraction plays an increasing part at smaller apertures. Point at which diffraction starts to offset effects of depth of increasing depth of field vary with lens and scene. Akram suggests standard focusing rule BUT try moving the centre point to and fro somewhat to suit your image. You can "cheat" with 1. a multiple image shot and careful post melding. 2. A panorama using a good stitching program where you use overlapping slices and move focus point somewhat per slice. –  Russell McMahon Apr 10 '12 at 5:12
3  
Lynda, check out dofmaster.com/dofjs.html - choose your camera (the D5000 will be fine in your case), focal length and aperture, and it will tell you how big the depth of field (the area in focus) is. You will see that at 18mm and f16, everything from 2ft to infinity will be in focus. Change the aperture to f5.6 and that drops to just 10ft. –  ElendilTheTall Apr 10 '12 at 9:01

3 Answers 3

up vote 9 down vote accepted

I think this is mostly answered, but I'll add some examples.

When a lens is focused at a particular distance, the image will appear sharp from some distance in front of the focus point to some distance behind it. The range from "nearest sharp point" to "most distant sharp point" is called depth of field (DOF).

Here's a Wikipedia example. The focus point is the "depth of field" text, and the DOF extends approximately from the line below to the line above:

DOF example

DOF depends on three factors. (That is, three factors you can easily change. DOF also depends on the size of the camera sensor, how large you want to print or display the picture, how closely you look and how critical you are, but I'll assume that these are constant.)

The factors you can easily change are

  • Aperture: Smaller aperture gives more DOF.
    Example: (All examples for Nikon D5100 or other APS-C 1.5x crop camera.)
    55mm f/5.6, focus at 10 feet: DOF range from 9 to 11 feet (2 feet total)
    55mm f/22, focus at 10 feet: DOF range from 7 to 18 feet (11 feet total)

  • Distance: More distance from camera to focus point gives more DOF.
    Example:
    55mm f/5.6, focus at 10 feet: DOF range 9 - 11 feet (2 feet total)
    55mm f/5.6, focus at 20 feet: DOF range 16 - 26 feet (10 feet total)

  • Focal length: Shorter focal length gives more DOF.
    Example:
    55mm f/5.6, focus at 10 feet: DOF range 9 - 11 feet
    18mm f/5.6, focus at 10 feet: DOF range 5 feet to infinity

So to maximize the depth of field, the basics are

  • Shortest possible focal length
  • Smallest possible aperture (although at very small apertures you run into diffraction blur instead)
  • If possible, increase distance between camera and foreground
  • Focus slightly behind the foreground subject, to exploit the fact that DOF extends some distance in front of the focus point.

Examples:

  • 18mm f/22, focus at 2 feet: DOF range from 1 to 12 feet
  • 18mm f/22, focus at 10 feet: DOF range from 2 feet to infinity
  • 18mm f/22, focus at infinity (the mountains): DOF range from ~2.5 feet to infinity.

So you could have everything from 2 feet to infinity in focus, by focusing at 10 feet.

If you want to go advanced, you could improve DOF slightly by focusing at what's called the hyperfocal distance. (Although you would need a table or calculator to look it up.)

Focusing at the hyperfocal distance gives the maximum possible depth of field, in this case that's

  • 18mm f/32, focus at 1.7 feet (hyperfocal distance): DOF range from 0.9 feet to infinity

That's the best optics can give you. If you need more than that, you'll have to fake it by taking multiple shots and merging them.


You can find these values from an online DOF calculator like the one ElendilTheTall linked to. Just select your camera (or another camera with the same size sensor, like D5000 in your case) and fill in focal length, f-stop and focus distance.

Note that these DOF values are only approximate: The DOF range is calculated using a definition of "acceptable sharpness" - subjects at the edges of the DOF range will be slightly out of focus, but we might still call them "acceptably sharp" - and what you consider acceptable will probably differ from the standard definition.
You will have to experiment to find your own limits, but a DOF calculator is a good starting point.

share|improve this answer
1  
+1 for the detailed answer –  akram Apr 10 '12 at 16:57
    
Yes, thanks for the detailed answer. => –  Lynda Apr 10 '12 at 17:11

How do you have both the background and foreground in the image in focus at the same time?

You need to close your aperture more. When you close the aperture (increase the f-stop number) you will have to increase the shutter speed to compensate. This increases your depth of field cause the digital sensor will have more time to record the scene (more photons hit the sensor). The rule of thumb when you want to have great depth of field is to set your aperture at high value then focus on 1/3 of the distance starting from the camera. For example if you have 6 objects lined in front of you on the same line, focus the camera on the second one. With the high f-stop you will achieve deep depth of field and you will be able to get the 6 objects in focus.

share|improve this answer

To achive very large depth of field the greatest gain is from using a small aperture - say around f/22. Smaller may work BUT diffraction plays an increasing part at smaller apertures.

The point at which diffraction starts to offset effects of increasing depth of field vary with lens and scene. Akram suggests a standard focusing rule of about 1/3 of distance from front to rear, which is technically about correct, BUT try moving the centre point to and fro somewhat to suit your image. How important front sharp or rear sharp is to final result will vary with scene and your desires for it.

You can "cheat" with:
1. a multiple image shot and careful post melding.
2. A panorama using a good stitching program that allows invisible joins, where you use overlapping slices and move focus point somewhat per slice.

share|improve this answer
    
The "cheat" method of melding the two shots in post was what I did to achieve the results I was looking for. –  Lynda Apr 10 '12 at 17:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.