Faux Depth of Field

by Ron Lacey

One of the creative tools available to photographers is the ability to restrict the depth of field in a photograph. Depth of field is the range of distance for which the subject is rendered in acceptably sharp focus in the photographic image. The photographer has a number of ways to regulate the depth of field when he takes the photograph. He can choose a small aperture (large ƒ stop number) which will increase the depth of field and conversely choose a large aperture (small ƒ stop number) to decrease it. Another regulating factor is the focal length of the lens being used. Longer focal lengths or telephoto lenses produce a tighter depth of field than wide angle or short focal length lenses. Since most digital cameras come with fixed lenses you change the focal length using the zoom, zooming in increases the focal length while zooming out decreases it. The third factor in determining the depth of field is the distance the lens is focused to. The further the subject is from the lens the greater the depth of field.

The above is common knowledge to SLR photographers and while useful to digital photographers less helpful to the vast majority who use the current generation of non SLR digital cameras. This is because digital camera sensors are much smaller than the 35mm film plane used by SLR cameras. For example, a typical digital camera CCD chip area is usually in the neighbourhood 7.2mm x 5.3 mm compared to the 24mm x 18mm 35mm film frame. As a result digital cameras use lenses of a much shorter focal length than SLR cameras to achieve the same angle of view. Typically a 10X zoom on a digital camera would require a 70mm lens while an SLR would require a 370 mm lens to achieve the same angle of view. Add to that the fact that most digital camera lenses have a very limited ƒ stop range and we have a real problem controlling depth of field. As figures 1.0 and 1.1 demonstrate it's much easier to present a clean non distracting background using an SLR than it is with a conventional digital point and shoot camera. Both photos were taken at ƒ5.6 but figure 1.0 was taken with a digital point and shoot camera while figure 1.1 was captured using a digital SLR.

figure1.0figure1.1

Creating a realistic lens blur in PSP

This is where the control the digital darkroom affords you comes to the rescue. In PSP we can use gaussian blur combined with layer masks and/or selections to realistically mimic a restricted depth of field. Accomplishing this in the photo above would be relatively easy. Since the background is located at a constant distance from the subject it's simply a matter of selecting out the foreground elements and applying a blur to the rest of the image. As you can see the SLR photo has a less distracting background making main subject stand out better.

Another reason to decrease the depth of field in a photo is to give it a more three dimensional look. When using a long lens on a distant subject the depth is compressed, that is things that may be hundreds of meters behind the subject appear to be quite close, distance is compacted which can cause the photo to look very flat. In this case adding lens blur to the background will give the scene a more three dimensional feel. We can't just select out the background and add the blur because a natural depth of field needs to fade gradually from sharp focus on the near ground to full blur on the far ground. This is where a mask layer comes in handy.

Below is an example of a photograph with a busy background where that gradually merges with the foreground. Let's run through the steps needed to add some depth to this image. If you want you can download a 1600X1066 copy of the moose photo (300kb) at http://ronstoons.com/moose.zip and follow along.

  1. Open your image in PSP and, in the Layers Menu select Promote Background Layer and then Duplicate.

    figure1.2
  2. With the duplicate layer active use the Rectangular Selection tool to define the area in the foreground you want to be in sharp focus.

    figure1.3
  3. Activate the Freehand Selection tool in Add mode to select the portion of the moose above the rectangular selection starting where the existing selection crosses the moose.

    figure1.4
  4. In the Selections menu Promote Selection to Layer (ctrl+shift+P) and Select None (ctrl+D).
  5. Turn off the visibility in the Promoted Selection layer and Activate the duplicate layer. Use the Clone tool to clone out the edges of the moose that were close to the selection boundary above the original rectangle selection. Do this by sampling (right click) a grassy area near the moose. You don't have to be too picky. This will prevent bleeding at the edges of the moose when we apply the Guassian Blur.


  6. In the Adjust menu select Blur>Gaussian Blur. The radius you choose will depend on the size of the image you started with, you'll want it large enough to give a convincing blur yet small enough so as there is some sense of detail. If you downloaded my image a radius of 20 pixels should do nicely. Turn on visibility for the promoted selection layer.

    figure1.6
  7. That's close but not quite there yet, the transition between sharp focus and blur is much too abrupt so we'll try a little masking. Right click on the blurred layer in the layer palette and choose New Mask Layer>Show All and expand the resulting layer Group.


    1. A mask is simply a greyscale layer that adjusts the opacity of the layers in below it in the group depending on lightness of the mask. Black in a mask makes the layer completely transparent while white makes it completely opaque, varying shades of grey allow for degrees of transparency. Because of this we can use this mask to fade in the effect of the blur from zero effect to full blur by simply using a gradient flood fill on the mask. Make the mask layer active and then set your foreground material to gradient.
  8. As soon as you activate the mask your Materials will display an 8bit greyscale palette. Double click on the foreground swatch to bring up the Material dialog and in the Gradient drop down pick Black-white and then choose Edit. Adjust your settings to reflect those below and click OK.


  9. Back in the Material dialog set the style to Linear, the angle to 180, repeats 0, and make sure Invert is UNchecked. Click OK.

In some cases this method can be used as an alternative to cloning out power lines and other distracting elements in a busy background.

Using different types of gradient masks will allow you to focus the sharp area where you need it.