Turtorial 1: Processing Single Frames
This tutorial will instruct you on how to use DOF PRO to generate a convincing DOF effect using a Depth Map. An advanced knowledge of computer graphics and animation is recommended in order to fully understand the following tutorial, although the same principles apply for using the filter in Photographic applications. DOF PRO does not have to be registered in order to use this tutorial, although you cannot apply the final DOF effect to the full image.
You can also download the entire tutorial and all associated media from the following link:
For this tutorial, we will be using the following images:
Simply click on each of the top two images to open it in a pop-up window. Then right-click and save the image to your hard drive for use in this tutorial. The third image to the left is what your result should look like upon completion of the tutorial.
1 - Begin by loading Photoshop® (or whichever graphics program you use) and opening chessRGB.gif.
2 - Under Filter>DOF PRO, select DOF PRO to execute the filter.
3 - Once the filter has loaded, take some time to familiarize yourself with the layout. We will be covering most of the features here throughout this tutorial. The filter Graphical User Interface (GUI) should look like this, or similar depending on which version of DOF PRO you are currently using. You should be in REGISTERED mode.

4 - The preview window shows you the image we will process. You can zoom in and out by using the zoom buttons. Clicking on Fit will display the entire image, possibly at a reduced size. Clicking on 100% will force the preview window to 100% which will show you the most accurate results but will take longer to preview.

5 - Let's get started by loading the Depth Map. DOF PRO defaults to a fixed defocus mode in which it will apply a consistent amount of defocusing to the entire image without the use of a Depth Map. Since we want to defocus specific areas of the image more than other areas, we will use a depth map. A Depth Map is a greyscale image where the grey level at any given point represents the distance of the object from the camera at the same point in the original image. To load a Depth Map, switch from Fixed Defocus mode to Depth Map mode in the Depth section.

6 - You will see many of the previously grayed out options are now available. Let's load the Depth Map by clicking on the Load button and selecting chessDM.gif from your saved location. If the load is successful, it will display the filname in the space provided.

7 - You may wish to see your loaded Depth Map at some point. To do so, simply click on View Depth. We can see that the Depth Map shows the chess piece in the foreground to be white and the chess pieces in the background to be black. Now you can use the F-Depth slider to set the desired focus depth. Leaving it at 255 will focus on the foreground while the background will be blurred. The reverse will be true when setting the focus depth to 0. You can display the so-called Focus Map by clicking on View Focus. In the Focus Map, focused parts will appear bright, whereas defocussed areas will be dark. To get an even clearer idea of how the Depth Map will interact with your image, click on Overlay. This will overlay the Focus Map and darken areas of the image which will be more defocused.

8 - Now let's introduce some defocusing. Under the Aperture section, increase the Size to 16.0. You should see the DOF effect becoming evident in the preview window. Assuming the F-Depth slider is set to 255, the chess piece in the front should be in perfect focus while those in the background become defocused. If you cannot see the effect clearly, use the Zoom buttons to enlarge the preview. If the rendering becomes too slow at a higher preview resolution, use the Res menu to lower the preview resolution.

9 - In a natural DOF effect, highlights tend to blow out and take the shape of the lens aperture. This is called a bokeh effect. Bokeh effects are an integral feature of DOF PRO and looking at our preview, we don't see them very clearly. DOF PRO contains a section called Highlights for bringing out bokeh effects and making them more evident. First click on the View Selected button. This will show you the currently selected highlights which will bloom into aperture shapes. Next, click on the View Processed button. This will show you the currently selected highlights and what they look like after they have been processed into aperture shapes. Since the currently selected aperture is circular, the highlights appear circular as well.


10 - In order to bring out the highlights, we can select more of the bright highlights in the RGB image using the Threshold slider and boost their luminance using the Enhancement slider. You may want to zoom in to 100% in order to see the resulting highlights more clearly. Set the sliders to the following values.

11 - Your highlights should now be much more evident and you should begin to see them take on the aperture shape. However, since our aperture shape is circular, they are still difficult to see. Let's change the shape to pentagonal. Under the Aperture section, select Pentagon from the drop-down menu. You will see the aperture icon change in the Rendering Console and you will see your highlights take the form of pentagons.

12 - At this point, our DOF effect is beginning to look fairly good. However, we can take it much further for an even more realistic result. If you look at the bokeh effect, you will notice the sharp pentagonal shape is somewhat unnatural. In most cameras, the aperture blades contain some amount of curvature as well as rotation. We can simulate this by using the Angle and Curvature sliders in the Aperture section. Set the sliders to the values shown below. You can monitor the current aperture properties in the Aperture Shape display just below the Rendering Console.

13 - Our pentagonal highlights should now feel more natural. Now let's closely examine our edges. Whenever you have a perfectly focused object in front of a heavily defocused background, edge artefacting tends to occur. This is a natural by-product of all post-render DOF filters mainly resulting from an antialiased depth map. Although Depth Maps are antialised by default, they shouldn't be as this produces inaccurate DOF results and creates edge artefacts. When we zoom in to 100% and take a look at the top of our focused chess piece in the front, we can see minor artefacting.
The top left image is the unprocessed RGB image enlarged by 200%.

The top right image is the processed RGB image without edge management enlarged by 200%.

The bottom left image is the processed RGB image after edge management enlarged by 200%.

These are not displayed in their correct size within the browser so please click on each image to see it properly in a pop-up window.
To compensate for this, DOF PRO has edge management tools for the reduction and/or elimination of edge artefacting. To use the edge management tools, click on Alias Depth Map under the Edges section, select the amount of the edge that you wish to correct using the Edge Threshold slider, and compensate for the now aliased Depth Map by using the Blur Img Edges slider. You can view your selected edges at any time by clicking on the View button.

Set the sliders to the following values.

14 - We should now have a very nice DOF effect on our image with natural looking bokeh highlights and clean edges. If you are happy with your settings at this point, you can save them using the LOAD/SAVE buttons. Finally, let's play with DOF PRO's most powerful feature, the focal depth selection tool. Using the Focal Depth slider located in the Depth section, you can change the focal point of the Depth Map on the fly, without having to regenerate a new Depth Map from your 3D software. To see how this works, first click on the View Focus button located in the Depth section. This will show you where your focal point currently lies. Since we have not changed the focal point at any time, it will be exactly the same as the loaded Depth Map.

Now change the Focal Depth slider to the following value.

You will see the brightest area of the Depth Map (the area in focus) shifts to the location of the second chess piece. Deselect the View Focus button and you will now see the second chess piece remains in focus and all others are defocused. Now, instead of using the slider to control where you want the focal point to be, turn on View Focus again and left-click in the viewport at the base of any of the chess pieces. You will see that you can interactively set the focal point using the mouse in the preview window.

15 - DOF PRO features a host of Depth Map editing tools such as Inversion, Brightness, Contrast, Gamma and Rotation, as well as advanced editing tools such as Stretch (Stretches a clipped Depth Map into its full range from 0-255), Clamp/Scale (for limiting minimum and/or maximum grayscale values or scaling between minimum and/or maximum grayscale values), and color selectors for specifying your Depth Map range. Using these tools, you can edit your pre-rendered Depth Map to accomodate any focal range from very wide, minimal ranges to extremely narrow, high contrast Depth Maps.

16 - If you look closer at the blurred background and compare it to the unprocessed image, you will notice that the blurring has removed much of the noise or grain present in the original image. DOF PRO offers a comprehensive toolbox to add specific grain. To restore the grain in the blurred background, use the following settings.

This concludes tutorial 1 of our DOF PRO Tutorial. We hope this has helped you understand the workflow required in generating high quality, sophisticated DOF effects with DOF PRO, as well as using the powerful highlight enhancement tools, edge artefact reduction tools, Depth Map editing tools, and grain generation tools. If you wish to use this tutorial with additional test images, you can use any of the images from the DOF PRO gallery and their associated depth maps. Once you are familiar with DOF PRO single frame processing, we recommend you complete tutorial 2, to understand DOF processing for animation.