One of the most important, and under-appreciated, technical aspects of photography is depth of field (DoF). Most people refer to it as “blur,” although computer media artists know that “blur” can mean much more than DoF. Simply put, DoF is the amount of area around the subject that is in focus. It separates foreground and background from the subject by causing a the foreground and background to appear out of focus, or “blurry.” The greater the DoF, the more things are in focus. The less the amount of DoF, the fewer things are in focus. Most photographers describe that quality as “bokeh.” This can be used in any number of ways, but the most common is to separate the subject from the background and/or the foreground of an image. There are also artistic reasons to consider, and we’ll look at those as well.
A More Scientific Look
Since photography deals with light and with optics, having an understanding of how light responds as it enters the camera is necessary to truly grasp how our digital counterparts will respond. There’s a fantastic discussion of that, complete with graphics, sliders, and mathematics, at this website, but for the sake of brevity I will simplify the discussion here. I would encourage you to visit the website and play with the web applet. It makes things clearer when you can see the changes for yourself as you control them.
DoF is determined by three functions of a camera’s lens – aperture, focal length, and focal distance. As light rays enter a camera’s lens, they do so from many directions. The smaller the focal length, the wider the aperture, and the closer the subject, the greater the angle that light can enter the lens. Conversely, the greater the focal length, the smaller the aperture, and the more distant the subject, the lesser the angle that light can enter it. It is this directionality of light that determines the DoF.
No, I promis that we’re not discussing Apple Software. In each camera lens, there are the glass elements that allow light to enter and strike the recording media, but there are a series of metal leaves that snap into place when shutter opens. These metal leaves, called the Aperture, control how much light enters the camera, where as the glass elements control HOW light enters the camera. (Click here for a GREAT applet that shows the balance between aperture, shutter speed, and sensor sensitivity in determining exposure). Typically, there are between 5 and 7 “leaves” (or “diaphragm blades”) in a lens, but there are some lenses with more and some with less. Telephoto lenses will typically feature more leaves than wide-angle lenses. Likewise, lenses with large glass elements will also have more leaves. Aperture has the most noticeable effect on the size of the DoF, but it does not operate alone.
Focal Length & Focal Distance
The focal length of the lens also plays a large role in determining Depth of Field. Longer focal lengths increase the length of the lens and decrease the directionality of the light entering the lens. As we discussed before, with the increase in the directionality of the light, comes a greater DoF. Since focusing involves moving the glass elements of the lens, changing the focal distance of the subject relative to the camera (by either moving the subject or the camera itself) will also increase or decrease the length of the lens, with the concurrent changes to the DoF.
Applications for Digital Work
In After Effects, virtual cameras function much the same way that real world-cameras do. There are a few descriptive differences, but the functions are essentially the same. Of course, there are also some things that a virtual camera can do that a real-world camera cannot. So let’s take a look.
Depth of Field in After Effects cameras is either switched on or switched off. Obviously if it is off, playing with camera settings will do nothing to affect DoF. The settings will be animated if you choose to do so, but there will be no change in either your preview or your final render. On the other hand, if the setting is switched to “on”, then those changes will appear in preview and final render. In After Effects, remember that all measurements are done in pixels, no millimeters like standard photography.
Focus Distance and Aperture use the same terminology as real-world cameras, but the number of aperture leaves receives the label “Iris Shape”; the iris is the hole created by the aperture leaves. A triangle is created by three, leaves, a square by 4, and so on. Beyond that, there are a number of options that do not have real-world counterparts, and deserve some attention. In photography, you cannot control the amount of blur after it has been generated by the lens elements. In After Effects, it is possible to control the amount of blur using the “Blur Level” control. 100% means that blur will appear as it would in a real-world camera, and it can be decreased accordingly by percentage. The iris rotation allows you to rotate the virtual iris leaves within the virtual lens. It theory it is possible to simulate this with a real-world camera, but it would be expensive and technically challenging to do so.
Iris roundness functions much like the roundness settings for shape layers. Going back to the real-world for a moment, when aperture leaves move into place, they create vertices where they cross in front of each other. Rounded aperture leaves avoid creating those vertices. But unless the user switches lenses, there is currently no way to control the amount of roundness at will with a real-world lense. After Effects, however, is under no such constraints. Use the the Iris Roundness setting to soften up some of the edges of your iris.
Lastly, Iris Aspect Ratio (IAR) controls how the virtual aperture leaves move together to form their shape. With an IAR of 1.0, the AE camera assumes that all aperture leaves will come together equally, forming a circle. The IAR describes an x:1 ratio, in the case of the default settings a ration of 1:1. As the IAR value gets higher, the shape becomes an oval of increasing width. This can generate some rather interesting results in your DoF! To the best of my knowledge, there is no camera that can alter it’s IAR “on the fly” like the virtual cameras in After Effects can do.
Please look at the examples below to see some of the topics addressed above work out in a comp:
Focus distance changes as focal length and aperture are unchanged.
Changing the aperture on a camera with a fixed focal length and fixed focal distance.
Putting it all together! Testing various aspects of the After Effects virtual camera – alone and in concert. Values are shown on the right as the animation progresses.