User Tools

Site Tools

This page exists within the Old ArtZone Wiki section of this site. Read the information presented on the linked page to better understand the significance of this fact.

Depth of Field in Post-Production

Author: thudfactor

Tools Needed

  • Poser
  • Photoshop 7


Poser 5 and other rendering programs now feature a “depth of field” rendering option which makes some items appear out of focus depending on how far they are from the camera. Not only does depth-of-field give your illustration more realism, it adds to the illusion of depth and helps guide the viewer's eyes to the focal point of your image.

But this depth of field effect can be unpredictable and it requires significant memory, computing resources, and time. For simple scenes, it's much easier (and faster!) to handle depth-of-field in post-production.

We'll be rendering the final image in layers, then merging those layers in Photoshop to turn the rather flat-looking image on the left into the image on the right.


Step 1 - Composition


This effect works best when the elements of your illustration exist in roughly parallel planes. In this composition, that's the case. The woman is in the foreground, the wall in the background.

Also note that in the foreground and middle ground at least, the elements of each plane are roughly the same distance away from the camera. The woman is perhaps six feet away, the wall about sixteen feet away.

Step 2 - Rendering


In Poser, set your camera angle and lights the way you want them. Then, make everything but the foreground visible and render that to a file. Then turn the foreground invisible and the middle ground visible and render that to another file with the same dimensions. It is absolutely vital that you do not move the camera or change the lights in between renders.

Above are separate renders of the wall and the woman.

Step 3 - Compositing


Load Photoshop and open both your foreground and background renders. Copy the foreground and paste it into a new layer on top of the background.

Then go to the “channels” pallet of your foreground file and look for a channel called “Alpha 1.” This should be an inverted silhouette of your foreground. Select all, copy, and then paste this into a new channel in your composted file (the one with both foreground and background layers). Name this channel “silhouette” (or something else you will remember).

Make sure the foreground layer is selected. Then go to the “Select” menu and choose “Load Selection.” Choose channel “silhouette” and make sure the “Invert” box is checked. Now you should have marching ants all around the white area of your foreground. Hit the backspace button to erase this.

There may be a white fringe around your figure afterwards; don't worry, we'll take care of that in the next step.

Step 4 - The Blur


Select your background layer, then choose Blur - > Gaussian Blur from the Filter menu. You can experiment with this value; the higher the number, the more out-of-focus the background will be. After a certain point, though, the background becomes so muddy the effect is lost.

To fix the halo around the foreground (and soften the unnaturally sharp edge of the figure in the process) start by making sure you have the foreground layer selected. Then control-click (option-click on Macs) the foreground layer in the layers pallet. This loads the transparency mask of the layer as a selection outline, essentially selecting your foreground.

From the Select menu, choose Modify - > Contract. Select a value that pulls the marching ants in to just a little bit inside the figure's shape. For a small image like this, I used a value of three. If you are rendering at high resolutions, however, you might go much higher. Then choose Select - > > Inverse. Now choose Filter- > Blur- > Gaussian Blur. Use a very small number for this. I used .5. This will blur the outline just a little bit, both getting rid of the fringe and softening the figure edges, giving it just a little more photographic realism.

Step 5 - Finishing Touches


To add a bit more realism, we'll add a little bit of an atmospheric effect and a slight shadow on the wall. Not only do shapes get more blurry with distance, they also turn a little lighter in color and lose some color saturation. So click on the background layer in the layers pallet and click the new adjustment layer button. Select “hue and saturation.” Pull the lightness slider slightly to the right, and the saturation slider slightly to the left.

To make the shadow, make a duplicate of the foreground layer and name it “shadow.” Lock the transparent pixels by clicking the first button in the layers pallet next to the word “Lock.” Fill the layer with black. Then unlock the transparent pixels. (You should have a black silhouette again). Choose Filter- > Blur- > Gaussian Blur and select an outrageously high number so that the shape of the silhouette is almost obliterated. The further away your figure is from the background, the larger this number should be. Put this layer under your foreground, then move it to where the shadow would naturally fall given your light conditions and how far away from the background your foreground is. I pulled my shadow almost straight down about halfway. To lighten the shadow effect, change the opacity. You can see below how this causes your foreground to pop out. Done delicately, you can do this without ruining the believability of your image.

Step 6 - Going further


As long as you keep the basic rule in mind – everything needs to be in its own plane – you can create very deep images. The further away something is, the more it gets blurred.

Below is a tourist standing in front of arches, with mountains in the distance. The arches are slightly blurred, and the mountains get blurred quite a bit.

Depth of focus works the other way as well – items in the extreme foreground can be as much out of focus as items in the extreme background, if your focus is on the middle distance. Working this out inside the renderer can be very time consuming, but if you plan ahead you can get the effect much more cheaply in your image editing program.