screamyGuy
Iris
LENS specifications often define the number of blades in the diaphragm. While this may seem somewhat irrelevant, it is a factor in determining the shape and aesthetic quality of the out of focus areas in a picture, often called bokeh (after the Japanese word for "blur"). When the optical cone of a lens does not converge to a point on the receptor, meaning that it is out of focus, it forms a circle of confusion that takes on the shape of the lens aperture. Since the shape of the lens aperture is defined by the diaphragm, the relationship between diaphragm and focal blur is easy to understand.

Certain diaphragm shapes are common among cameras. Most inexpensive lenses will have five blades that create pentagon blur. Better lenses, especially those of the portrait variety, will use nine or or more blades in an effort to create the most visually unobtrusive blur. Certain telephoto lenses known as reflex lenses use a Cassegrain mirror arrangement to compact the lens. Here, the aperture is a fixed size in the shape of a donut where an optical flat is obscuring the center of the lens. A standard compact camera will either have fixed aperture or a swash plate with perfect circles cut into it.

Approximating Blur

A single point on the receptor will represent the sum of all contributing circles of confusion. Consequently, it can be approximated in reverse using a standard convolution filter where the kernel is representative of the aperture shape and visibility. This implies that a larger aperture will use a larger kernel creating more blur, emphasizing that large apertures have shallow depth of field.

Shape is not the only defining factor for blur -- light distribution within the aperture is important and a key performance parameter during design. In a theoretical lens with a completely uniform field, the convolution kernel visibility would be a step function -- either fully visible within the aperture or fully occluded outside. In this case, a four bladed aperture would perfectly approximate a box blur. Realistically, light falls off across the lens and is usually darker at the edges. Gaussian convolution kernels provide the smoothest blur, so light falloff across a lens should approximate a Gaussian.

The applet below allows you to define an aperture's shape and falloff and visualize the blur quality by convolving a reference image with the aperture.

You need to install or enable Java to view this content. Get it from java.com
Figure 1. Iris Simulator. Image on right will show the blur generated by the current aperture after rendering. Left image will show the previous image for comparison. Images may take 5-10 seconds to render on slower computers. f stop numbers are approximations based on sampled area.

Interesting Cases

I'd like to pretend that you could tell the difference between a five bladed iris and a ten bladed version, but the reference images provided here don't have sufficient resolution (I kept them small to keep processing time in check). For the discerning, cross your eyes to merge the pictures for 3D goodness. Differences will pop off the screen and be easier to detect. This may give you a headache - you've been warned.

The effect can best be observed in the degenerate cases. Compare the blur generated by a 5 bladed iris with that of a two or three bladed version. In these cases, the shape of the iris can clearly be seen in the blur of the lamp on the roof of the building. If you create a slit with two blades, the image will seem to blur at the angle of the slit. This is equivalent to the directional blur in Photoshop® . The reflex lens simulation is especially interesting. The bokeh takes on the shape of a ring or donut. This type of bokeh is usually considered especially offensive and is the reason most photographers avoid reflex lenses.

Real World Fun

Figure 2. Paper apertures placed over the front of a telephoto lens.
Your camera provides a single aperture for your use, but this does not prevent you from creating your own by modifying the big aperture at the front of the lens. For quick effects with a telephoto lens, use a lens cap as a template to cut circles out of a sheet of dark paper. Next, cut a shape into the paper and place the sheet over front element of the camera lens. The blur will take the shape of your image (ducky, ampersand, happy face... be creative). To be effective, this technique typically requires extremely blurred point lights in an out of focus field. Here, I've used candles against a dark background. Additionally, Figure 3 is near-macro for extreme bokeh.

3a. f/223b. f/2.83c. Happy Face
3d. Cross 3e. Slash 3f. Star
Figure 3. Paper apertures placed over the front of a telephoto lens cause the bokeh to assume the shape of the aperture.

Files

by Matthew Kozak
All code GPL