# How does light focused through a lens create bokeh (blurry background)?

This question is relevant, though I don't think it quite answers the question.

From a photography perspective, when you open the aperture wide (with a small f-number) you get a very shallow depth of field. Everything outside that narrow field of view shows up blurry. Like this pineapple is crisp and clear, but the grass in front and behind are out of focus.

From a physics perspective, what I (think I) understand is that the image is formed by a photon bouncing off the pineapple, entering the lens, bouncing around a bit, and finally reaching a pixel on the sensor. What I'm confused about is the blurry parts. Surely you can't change the size of the photon... can you?

The problem is that images aren't formed by one ray of light, they're formed by countless rays of light!

A "bundle" of light from the sun ("bundle" meaning a ray localized in space but containing many many photons) will hit the surface of a blade of grass, and all the photons will disperse in a diffuse manner in every direction.

So a bundle of light hits a point on the blade of grass and a sphere (or, a half-sphere) of light expands from this point. Imagine that expanding more, and more, until some chunk of that sphere passes through the aperture of the camera.

It's then the job of the lens to take that light (which is hitting the entire surface of the lens at all different angles) and focus it down onto a point on whatever photosensitive surface is inside the camera!

But you can't just magically change the direction of a ray of light, you have to do it by mere mortal means, in the form of a slab of glass. Even simple lenses act in a way that's rather complicated. (All the formulas on the wikipedia page on lenses use something called the paraxial approximation, and aren't 'exact', which is why there are so many exceptions to the equations)

Basically, the answer is that this glass lens which changes the direction of rays of light through mere mortal means, will only focus rays to a point on the photosensitive surface if the rays all originate from a specific distance.

I drew some pictures for this on a different post I made on google+. Imagine the leftmost green line is the blade of grass, the middle green line is the lens, and the photosensitive surface is somewhere to the right. In this first case, the subject is too close and a bundle of light hitting the blade of grass will spread out over the whole photosensitive surface (blurry).

Animated version of the following image

In this case, the blade of grass is far enough away. If you put your photosensitive surface to the right of the lens, where all the rays converge, then your subject would be in-focus. If you put it anywhere else, it would be out of focus and slightly blurry!!!

Animated version of the following image

• "bundle" meaning a ray localized in space but containing many many photons that was the source of my confusion. I didn't realize that you could have multiple photons in the same space. Is that due to the wave-like nature of light? Meaning you have one ray of light containing a multitude of photons with a certain amplitude. When that ray hits the pineapple, or grass, then the amplitude of the wave decreases, but the... I guess you'd say number of waves increase? Or maybe more accurately the number of directions the wave is traveling increases while the amplitude decreases? – Wayne Werner Aug 20 '15 at 18:51
• @WayneWerner Well... the quantum way to look at it is that yes, photons are bosons and bosons are allowed to occupy the same state (2nd paragraph here: en.wikipedia.org/wiki/Boson ). The classical way to look at it is that light is just ripples on a pond and there is no such thing as a photon. It turns out that when you get $10^7$ ripples per meter moving at the speed of light, ripples on a pond can be approximated awfully well as rays. – user12029 Aug 20 '15 at 18:54
• @WayneWerner whatever you do, you can't think of photons as billiard balls! This is how you should think of diffuse reflection physicsclassroom.com/Class/refln/u13l1d6.gif . It's also the case that the amplitude decreases, and it's also true that the number of directions the rays are travelling is increasing, and it's also true that this is due to the fact that light is composed of waves, but it's a handy and immensely accurate approximation to treat the waves as rays. – user12029 Aug 20 '15 at 19:01