Bokeh is a picture of the aperture

Defocus is normally implemented as a Gaussian blur, which is wrong in a way that is obvious once you have seen it. A lens does not spread a point into a bell curve. It spreads it into the shape of its own aperture, at a size set by how far out of focus the point is.

The same points at four apertures: ideal circle, six blades, five blades, and an anamorphic oval.

Why it is a shape and not a blur

Every point of light reaching the sensor from an out-of-focus object arrives as a cone that has not converged yet. What lands is a cross-section of that cone, and the cone was shaped by the aperture it passed through. A six-bladed iris makes hexagons. That is not a stylistic filter, it is a photograph of the hole.

Which is why blade count is a look. Five blades gives pentagons with a point up. Rounded blades give something between a polygon and a circle. Wide open, most lenses are nearly circular, and the polygon appears as you stop down, which is a detail worth getting right if the shot is meant to read as a specific lens.

The rim is the tell

A defocused disc is not uniform. Spherical aberration piles light up at the edge of the circle of confusion, so a real bokeh ball is brighter at its boundary than in its middle. Some lenses go the other way and are brighter in the center, which reads as smooth and creamy. Flat, even discs are the one thing that almost never happens optically.

float disc = insideAperture(q, R);
float rim  = smoothstep(R*0.72, R*0.97, length(q)) * disc;
col += tint * (disc*0.16 + rim*0.42);   // rim carries most of the energy

Turn the rim term off and the highlights immediately read as pasted-on circles. It is the cheapest believability in the whole effect.

Anamorphic, briefly

An anamorphic lens squeezes horizontally, so the aperture is effectively an oval and the bokeh comes out as vertical ovals rather than circles. Combined with the horizontal flares those lenses are known for, it is a strong and instantly readable signal that a shot is meant to feel cinematic. It is also very easy to overdo.

Rules of thumb

  1. Blur with the aperture shape, not a Gaussian.
  2. Brighten the rim. A flat disc is the giveaway that it was faked.
  3. Blade count is a lens choice: 5 and 6 read differently and both read as real.
  4. Size scales with defocus distance, so it belongs to depth, not to a global slider.
  5. Only bright points make visible bokeh. Applying it everywhere just looks like blur again.

All 61 notes How to use them Credits