Turtorial 2: Processing Animation
This tutorial will instruct you on how to use DOF PRO to generate a convincing DOF effect on a sequence of images using a sequence of Depth Maps. In addition, you will learn how to setup and keyframe a simple animated effect. It is recommended that you first complete tutorial 1
before attempting this one. 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 sequence.
You can also download the entire tutorial and all associated media from the following link:
For this tutorial, we will be using the following first two sequences in industry-standardized, sequentially padded BMP file format. You can download them below from the links located in the bottom right-hand corner box. The final DOF processed sequence is shown so that you know what your result should look like.
1 - Begin by loading Photoshop® (or whichever graphics program you use) and opening dominosRGB_0000.bmp (from the downloaded archive).
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 dominosDM_0000.bmp from your saved, unarchived 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 dominos in the foreground to be white and the those in the distance 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 set our initial settings. Set the following variables to match the values in the image. 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 - At this point, the image in your preview window should look like this. Our focal point has been set to just above the bottom of the frame.
10 - Now that we've set our initial settings, let's turn on batch processing and begin to set up our keyframing. To turn on batch processing, click on Configure. You should see the batch processing window appear similar to the one below. You will notice several things. First of all, your RGB image filename has been transferred to the Source Image Filename section. Also, because we have loaded an external depth map, the filename of the depth map has also been transferred to the Depth Map Filename section. Finally, a suggested output filename has been entered in the Output Image Filename section, based on the source image filename. Any of these filenames can be changed but it is very important to make sure they all contain the same filename counter - in this case, 0000. If the counters do not match between the filenames, DOF PRO will report an error.
11 - The first thing we'll do is rename our output filename to something simpler and more concise. Rename your filename to dominos_DOF_0000.bmp, as shown below.
12 - Next, you will notice the start and end frames of the sequence. DOF PRO does an automatic seek of any sequence and displays the available frames for you. This sequence contains 150 frames, starting at frame counter 0000 and ending at frame counter 0150. You can adjust the start and end frames of your sequence at any time in case you only wish to process a selected number of frames. If you set the start or end frame sliders to values in which frames do not exist, the counter will turn red as a warning. Since we wish to process all 150 frames, we will leave the settings untouched.
13 - Below the frame range selectors, you will see the log file options. Create Log File is enabled by default and everytime you process a sequence, a log file is generated in the plugin root folder with detailed information including filenames, timeframes, and other helpful data. The log file is also important in the event of an error since you can review it and see where DOF PRO encountered the error. Display Log File will launch your default text editor and show you the log file. Generally, it is recommended you leave these options on.
14 - At this point, we are ready for keyframing. Keyframing involves setting values for one frame, then changing those values at another, and having DOF PRO interpolate between the two keyframes. DOF PRO follows industry-standardized keyframing workflow so anyone familiar with keyframing will easily understand how to keyframe in DOF PRO. Let's take a minute to familiarize ourselves with DOF PRO's keyframing features. The dropdown menu on the left will display the function curve for the selected slider. It is important to realize that when you set a keyframe, all sliders are keyed, not only the currently displayed slider. That's because the currently displayed slider simply shows that slider's keyframe information.
The dropdown menu on the right will select the type of interpolation scheme for all keyframes. Again, it is important to realize that when you set an interpolation scheme, all sliders are affected, not only the currently displayed slider. That's because the currently displayed slider simply shows that slider's keyframe information. Various common interpolation schemes are available, including custom which allows you to have full control over the ease in and ease out of your keyframe.
The Frame slider is your keyframing timeline. It will range from your start frame to your end frame and you can scrub back and forth to any desired frame in order to set, delete or edit your keyframes. If you move it to a frame that has a key on it, the slider will turn yellow, otherwise it will remain grey.
The Set Keyframe button will set a key on the currently selected timeframe. Once you set a key, the other greyed out keyframe options will become active. You will also notice that the text on the Set Keyframe button has now changed to Del Keyframe and clicking on it will do just that. << Prev KF will allow you to jump to the previous keyframe, if any. Next KF >> will allow you to jump to the next keyframe, if any. Copy will become active if you are on a keyframe and clicking on it will allow you to copy all keyframe values from that frame. You can then scrub to another frame and click on Paste which will create a new keyframe with the previously copied values. View Frame will update the preview with the currently selected frame's keyframed values. Reset KFs will reset all keyframe data. In and Out will become active if you select the Custom interpolation mode. These sliders allow you to precisely control the ease in and ease out of the current keyframe. You will notice that because our F-Depth is set to 210 as opposed to 255, the function curve is slightly lower than the top of the function curve window. Adjusting the F-Depth slider will interactively change the function curve value and you will see it move higher or lower.
15 - Let's begin by setting a keyframe at frame 0. Click on the Set Keyframe button. The timeframe slider will turn yellow signifying you have set a key. You can also browse through all the different function curve keyframe values by selecting a different slider from the keyframing dropdown menu.
16 - If we study the sequence we are working with, we can see that the camera begins to move around frame 20 and comes to a rest at frame 60. Therefore, these are the two frames we will be setting keyframes on. Having said this, frame 0 didn't require a keyframe since it will be the same as frame 20. However, for tutorial purposes and clarity we have set one. We will be keying two different values - we will be changing the focal depth as well as increasing the aperture size. Let's continue by setting the next keyframe. Advance to frame 20 using the timeframe scrubber and once again click on the Set Keyframe button. Again, the timeframe slider will turn yellow signifying you have set a key. You can now jump back and forth between the two keyframes by using the << Prev KF and Next KF >> buttons. Now lets try the copy and paste buttons. While on frame 20, click on Del Keyframe to delete it. Now using the << Prev KF button, go to frame 0 and click on Copy. Use the timeframe scrubber to go back to frame 20 and click on Paste. You will see a new keyframe created - one with the same values as frame 0. Your F-Depth function curve should now look like this:
17 - Now let's advance to frame 60 using the timeframe scrubber. Change the F-Depth slider from 210 to 170 and change the aperture Size from 8 to 12. Once again click on the Set Keyframe button. The timeframe slider will turn yellow signifying you have set a key. Your function curve should now look like this:
18 - Let's take a look at our aperture size curve. From the left keyframing dropdown menu select Aperture Size. You will now see a different function curve and it will show that the aperture size remains constant from frame 0 to 20, then increases slightly to frame 60. Your Aperture Size function curve should now look like this:
19 - At this point, we've keyframed our sequence and we're almost done. If you scrub the timeframe slider you will see the results of your keyframes as your sliders animate from one keyframe to the next. The last step we must make is to set the appropriate interpolation scheme. Interpolation describes the way in which DOF PRO animates from one keyframe to the next. The fault is always set to linear but this results in abrupt animated changes. If we study the sequence we are working with, we can see that the camera move between frame 20 and 60 is smooth, not abrupt. When it was animated in 3D, the interpolation schemes used were ease ins and ease outs One does not need to know this information as it can be clearly seen in the footage. In order to match our camera's motion, we will also set our interpolation scheme to something similar. First, set your function curve display back to F-Depth in the left keyframing dropdown menu. In the right keyframing dropdown menu, change the interpolation mode from Linear to Cubic Ease In/Out. You will see your curve smooth out between the keyframes. However, there is also a slope increase between frame 0 and frame 20 due to the fact that we set a keyframe at frame 0 which wasn't necessary. Now change your interpolation scheme again from Cubic Ease In/Out to Cubic Flat Interpol. You will see the slope increase between frame 0 and 20 disappear. Cubic Flat Interpol. is the same as Cubic Ease In/Out but it will keep interpolated values between identical keyframes flat. Therefore, this is the interpolation scheme we want. Your F-Depth function curve should now look like this:
20 - Congratulations! You've now successfully keyframed your own sequence and you're done. To activate your keyframed process, simply click on Execute and let DOF PRO do the rest!
This concludes tutorial 2 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 for animation. If you wish to use this tutorial with additional test images, you can use any of the sequences from the DOF PRO animation gallery and their associated depth maps.