Tilt-shift photography: how it works

Special lenses and clever post-processing

Model behaviour

Tilt movements are used in two contexts: landscape photography where you would prefer having more of the view in focus, and diorama effects.

The diorama effect is a process that converts a photograph of an ordinary view into one that looks like it was taken of a scale model.

Figure 4 shows this effect on a line of beach huts, and you may also have noticed the diorama effect in the titles for the BBC TV series Sherlock.

Figure 4
Figure 4: Some beach huts showing a diorama effect produced by Gaussian blur

The reason this effect works is that, through exposure to photos of miniature scenes and landscapes, we know how the depth of field operates for small scenes versus large scenes.

For miniatures, the depth of field is very shallow, even at small apertures. This means that, even with small distances closer to or further away from the camera, the depth of field falls off dramatically. Take a look at Figure 3 again to see the effect.

For landscape photos, even when the aperture is wide open, the depth of field is usually quite large; more of the view is seen as being in focus, even though the focus plane is still well defined and shallow.

A simple way to create the diorama effect, therefore, is to trick the eye by blurring the region of the image closer to and further away from the object of interest in the view.

This reduction of the depth of field can be achieved using a tilt movement, or it can be done through some post-processing of the image. Figure 4 was produced by post-processing – in this case through some Gaussian blurring in Adobe Photoshop.

A blur is a mathematical operation used in graphics software to smooth out detail and reduce image noise. A Gaussian blur gives the effect of viewing a photo though a ground glass screen.

The simplest blur is a box blur. In this type of blur the pixels in the original image are transformed into the pixels of the resulting image by averaging out the values of neighbouring pixels.

So if we take the nine-pixel box around a pixel (the pixel itself plus its eight neighbours), a simple box blur would be to take one ninth of each pixel value in the box and sum them (which, of course, is the same as averaging the nine pixels).

In reality you would average each of the three colour channels and recombine them to form the value for the new pixel. You could also average the pixels in a 5x5 box or a 7x7 box to emphasise the blurring even more.

Another technique would be to vary the weighting of values of the pixels in the box so that, for example, the pixels that are closer to the reference pixel have a higher weighting than those further away (and thereby affect the final value of the resulting pixel more than those further away).

These types of box blurs are more properly known as circular blurs, since it's the distance from the central pixel that's of importance, and that can be viewed as a series of concentric circles.

One of the best known examples of circular blur is the Gaussian blur.

Here the weighting of the pixels in the box follow a Gaussian or normal curve (the familiar bell-shaped curve) so that pixels close by have a large weighting. This falls off rapidly the further away you get from the mid-point of the bell until you reach the long tail.

The problem with the Gaussian blur is the sheer number of calculations that are required in order to calculate the new value of a pixel. In essence, each neighbouring pixel value is multiplied by its weighting, the total of these products is accumulated, and the final total is divided by the total weighting.

For a reasonably sized box, the number of multiplications grows quite quickly (it varies as the square of the side of the box).

Luckily, there are some shortcuts that you can use to calculate a Gaussian blur.

The first one lets you apply a box blur in two steps instead of one: you can apply the blur horizontally (it's essentially then a one-dimensional 'line' blur), and then apply it vertically. The result is the same as applying the standard box blur.

With a box blur that uses a simple average this trick isn't particularly worthwhile, but it also works extremely well for a circular Gaussian blur. This means that you can reduce the number of calculations quite quickly – instead of being proportional to the square of the box side, it's now proportional to the length of the box side.

However, there is yet another trick up the graphics algorithmist's sleeve. Using the Central Limit Theorem, one of the major results of probability theory, it turns out that if you apply a standard box blur three or perhaps four times in a row, the result approximates a Gaussian blur extremely well.

Since a box blur is extremely quick to calculate (it's a summation followed by a division after all – no weightings in sight), this makes a pseudo-Gaussian blur very quick to calculate.

Focus on blurring

Back to the diorama effect.

Now we can simply select a narrow area or band of the photograph to be in focus, and everything above or below that band to be Gaussian blurred.

If we are clever we can 'band' the blurs themselves so that the closer we are to the focused band the smaller the radius of the blur, whereas the further away, the larger the radius. This will give a pretty good diorama effect.

The diorama effect can't be applied to all photos.

For a start the photo must be a fairly wide angle of view, like a landscape, with no large objects in the foreground. The eye would use them to gauge distances, which would negate the blurring effect.

The more eligible photos would also be taken at a slightly elevated angle.

Nevertheless, diorama or tilt effects are extremely addictive to make using post-processing of images, and don't require expensive gadgets like view cameras or tilt-shift lenses.