The solution: We need to focus on an intermediate location so that the furthest extent of the depth of field just reaches infinity, and so that the depth of field shifts forward to put as much of the scene in sharp focus as possible. That location is the hyperfocal distance. In our imaginary portrait, the hyperfocal distance is about 18 feet. If you set the camera's focus on 18 feet, the near limit of the depth of field is 9 feet. And the far limit is (and always will be for a hyperfocal shot) infinity. Take that shot, and the 10-foot-away subject and everything to infinity will look sharp.
Where did all those numbers come from? How did I know what the hyperfocal distance would be? In the age of film photography, camera lenses had hyperfocal marks inscribed on them, but those days are long gone. Now, the easiest way to tell is with a tool that calculates the hyperfocal distance for you.
My favorite is the online depth-of-field calculator DOFMaster. Just enter the kind of camera you own (if you don't see your particular model, you can pick a similar one), and choose the focal length of your lens. On the right side of the page, you'll see the hyperfocal distance listed. Enter that number in the 'Subject distance' field, and calculate—you'll be rewarded with the near and far limits of the depth of field.
If you have an iPhone, the DOFMaster app ($2) is even easier to use. After specifying your camera settings, tap the HD (hyperfocal distance) button to learn what distance to focus on and what the near and far depth-of-field limits are.
Of course, hyperfocal photography is really practical only on cameras that let you both control the aperture and manually set focusing distance, so digital SLRs and advanced compact cameras will have an easier time. Smartphones and very simple point-and-shoot cameras, on the other hand, lack a way to set the focus distance to a specific value, so they are not good candidates. That said, the tiny size of smartphone image sensors means that smartphone photos tend to have a fairly deep depth of field anyway, so with a little experimentation, you can often get hyperfocal-like photos without any special effort.
Sign up for CIO Asia eNewsletters.