Jakub Trávník's resources

On Bokeh

The first part of article - On Bokeh Character - is here. I plan to produce a part about bokeh size and a part with some of my pictures related to bokeh theme later. I also plan to add more illustrations. This is work in progress.

Table of Contents

What is bokeh?

Bokeh is a word which photographers use for an appearance of out of focus parts of the picture. Each bright element in scene that is out of focus contributes to overall appearance. Bokeh can be observed best on bright dots which are out of focus and surrounded by dark background. Basic shape of such highlights is a filled circle. There are some geometry rules that tell how big it will be. Those are generally known. So I will skip this part for now. What I find interesting is character of bokeh.

On Bokeh Character

What affects bokeh shape?

The character of bokeh is best observed on small light sources. This character is mainly given by optical construction of lens. Most of modern lenses have rounded aperture blades. Older straight aperture blades produced polygonal out of focus highlights (if aperture was slightly closed). While the aperture blades are rounded in current lenses they may still be slightly visible in some aperture settings. Sometimes a single blade is slightly misaligned and more visible than others. I have seen too often marketing claim "rounded aperture blades produce pleasing bokeh". But rounded aperture blades are not guarantee of pleasing bokeh.

So what else goes into a character of bokeh? Sometimes what would be a circular out of focus highlight in the center of the image has a lemon shape outside of center, gradually more near borders and edges. This is caused by mechanical vignetting because the optical path in the lens is too narrow. Resulting shape is often a intersection of two non-concentric circles, often described as "lemon shape" or "cat eye".

Distracting bokeh or not?

While shape of bokeh can be slightly distracting if it is not circular, there is another issue with out of focus highlights. It's a distribution of light inside of them. The differences in light density around edges of out of focus highlights have these basic types (red graphs show light intensity from the marked areas):

bokeh types and light intensity graphs for each type

Why is there such light distribution?

Optimally corrected lenses focus all the entering rays from single point light source to a single point in image plane (at proper focus distance). Real lenses have various aberrations so what should be a point in image plane as produced by point light source is not a point, but rather some foggy ball. An aberration that causes light rays to be focused on different image planes depending on whether the ray goes through center of lens or sides is called spheric aberration.

Image below demonstrates spherical aberration. A lens being simulated (by my custom tool) has two biconvex elements, both with material with refraction index of 1.5. Both elements are spherical so whole lens has spherical aberration with no correction. Chromatic aberrations are not simulated. Light rays are randomly colored so you can easily follow each one.

ray traced example 1

Next image below uses white rays, but there are more of them to get better idea how this affects image plane.

ray traced example 2

Next image below uses 800 rays that can overlap to approximate whole light field generated by that the single light source in whole lens. Red vertical lines are sections of that light field that show how would the light appear if image sensor would be at that position - that is the bokeh.

ray traced example 3

Next two images show a different lens with two elements, almost same as lens above, but with corrected spherical aberration. Three surfaces of the two elements are same, but one has been changed from a sphere to a slightly different curve. Specifically, the equation for original spheric surface was x = 10*cos(alpha); y = 10*sin(alpha) while the new aspheric surface has this equation: x = 10*cos(alpha)+13*alpha^4; y = 10*sin(alpha).

ray traced example aberration corrected 1
More detailed light field:
ray traced example aberration corrected 2

Next two images show another lens almost same as lens above, but with overcorrected spherical aberration. Corrective part of equation was multiplied by 1.3 so the corrective effect stronger than it should be. Equation is x = 10*cos(alpha)+1.3*13*alpha^4; y = 10*sin(alpha).

ray traced example aberration over-corrected 1

More detailed light field shows the bokeh appearance is reversed in lens with over-corrected spherical aberration in comparison with the original lens which was completely uncorrected:
ray traced example aberration over-corrected 2

Now, this simulation above may look too artificial and unintuitive. Real lenses do not behave like this, right? They actually do. Just look at this picture below. It is taken by D90 with Sigma 50/1.4. The test target is here: bokeh-test-lines.png (you can try it with your lenses) and it is displayed on notebook LCD monitor. Camera is at angle so that left side of LCD is farther than focus point, right side is closer.

real bokeh sample of lens with under-corrected spherical abberation on bokeh-test-lines.png target

There are red and green colored edges of bokeh - that is longitudinal chromatic aberration. If you ignore red and green colored edges, it corresponds pretty well to the simulated sample of under-corrected spherical aberration, displayed (again) below:

ray traced example 3 (again)

Implications of lenses with under-corrected or over-corrected spherical aberration is that:

With such knowledge, following types of classic lens behaviors will not surprise you (numbering is mine, non-standard, but I will use it for the rest of the article):

Note that effect of spherical aberration is strongest close the focused plane. So if you focus on close distance, SA may not be impacting highlights at infinity that much. But if you focus far, SA will impact it.

Bokeh Samples

Sigma 50/1.4 DG HSM

Samples of Sigma 50/1.4 DG HSM which mostly belongs to type 3 - the rear bokeh has softer edges and front bokeh has more noticeable edges (note: both pictures are JPGs in landscape picture control with sharpening value 5 of range 0 to 9):

sigma 50/1.4 bokeh example overview
sigma 50/1.4
        bokeh example profile

But things are not so simple when used on full frame camera. Background bokeh outside of APS-C frame is distracting. Look at two pictures below. The first is at f/1.4, the second is at f/2.5, both out of camera JPEG taken with Nikon D600. Both show that in about APS-C frame the Sigma 50/1.4 has smooth background bokeh, while near corners, sides and elsewhere outside of APS-C frame, the bokeh is not smooth, it is edgy. Just compare center area with bottom right corner. It is also quite triangular in corners.

sigma 50/1.4 bokeh on full frame at f/1.4 outdoor
Sigma 50/1.4 outdoor at f/1.4. Click here to see full 24MP picture.


sigma 50/1.4 bokeh on full frame at f/2.5 outdoor
Sigma 50/1.4 outdoor at f/2.5. Click here to see full 24MP picture.

Additional bokeh samples of Sigma 50/1.4 using bokeh-test-lines.png with focus distance around 1m, on tripod, at several apertures, Nikon D90:

sigma 50/1.4 bokeh summary

f/1.4 t=1/20s
f/2.0 t=1/10s
f/2.8 t=1/5s
f/4.0 t=1/2.5s
You can see there is some focus shift, but note that focus ring was not moved during those exposures (and camera was in manual focus mode). Best focus for f/1.4 is near center of screen, but best focus for f/4 has moved to the left (farther).




Nikon 50/1.8G AF-S

Nikon 50/1.8G AF-S has similar type of bokeh as Sigma 50/1.4. Note that Nikon 50/1.4G AF-S is different. Bokeh in background is smooth, bokeh in foreground has pronouced edges.

Nikon 50/1.8G bokeh on bottles

Additional bokeh samples of Nikon 50/1.8G using bokeh-test-lines.png with focus distance around 0.8m, on tripod, at several apertures, Nikon D90:

Nikon 50/1.8G bokeh summary

f/1.8 t=1/13s In fact there is no change visible between f/1.8 and f/2.0. Perhaps aperture lever is not well calibrated? Brightness change is due to shutter time change.
f/2.0 t=1/10s
f/2.8 t=1/5s
f/4.0 t=1/2.5s

Here is outdoor series of pictures with varying apertures:
f/1.8 f/2.2 f/2.8 f/4.0
Look how bokeh is smooth enough in the center. But it is not so smooth even near bottom and on sides. Note that this is DX frame. While Sigma 50/1.4 has also less smooth background bokeh outside center, the effect is only visible in FX frame.




Sigma 85/1.4 DG HSM

Samples of Sigma 85/1.4 which mostly belongs to type 1 (shorter focus distances), and to type 2 (longer focus distances). Both rear and front bokeh is fairly "flat" or normal at shorter distances, but front is slightly more smooth. At longer focus distances you can see edges very clearly. I would rather prefer more smooth rear bokeh, like I have seen in pictures of cheap Samyang (or Vivitar) 85/1.4, but that one does not autofocus. These were captured as JPG in portrait picture control with sharpening 5 of range 0 to 9.

sigma 85/1.4 bokeh example overview
sigma 85/1.4 bokeh example profile

Comparison of Sigma 85/1.4 background (rear) bokeh at shorter and longer focus distances:

sigma 85/1.4
        background (rear) bokeh for shorter and longer focus
        distances

These statues are in my favorite location for photography practice at the Vinohrady Cemetery in Prague. You can also see high amount of purple fringing near highlight-dark object for f/1.4 (left picture), somewhat less for f/2.0 and none for f/2.8.

Additional bokeh samples of Sigma 85/1.4 using bokeh-test-lines.png with focus distance around 1.4m, on tripod, at several apertures, Nikon D90:

sigma 85/1.4 bokeh summary

f/1.4 t=1/20s
f/2.0 t=1/10s
f/2.8 t=1/5s
f/4.0 t=1/2.5s
You can see there is no focus shift. Bokeh is neutral.





Sigma 30/1.4 DC HSM

Samples of Sigma 30/1.4 (this is the one that sold in 2009, there are newer editions of 30/1.4 lens from Sigma that are different) which mostly belongs to type 3 - the rear bokeh has softer edges and front bokeh has more noticeable edges (note: both pictures are JPGs in portrait picture control with sharpening value 5 of range 0 to 9):

sigma 30/1.4 bokeh example profile
Unlike Sigma 85/1.4 and Sigma 50/1.4, this Sigma 30/1.4 has noticable polygon bokeh appearance at f/2 due to shape and position of aperture blades. The aperture blades are slightly rounded.

Additional bokeh samples of Sigma 30/1.4 using bokeh-test-lines.png with focus distance around 0.7m, on tripod, at several apertures, Nikon D90:

sigma 30/1.4 bokeh summary

f/1.4 t=1/20s
f/2.0 t=1/10s
f/2.8 t=1/5s
f/4.0 t=1/2.5s
You can see there is some focus shift, but note that focus ring was not moved during those exposures (and camera was in manual focus mode). Best focus for f/1.4 is near center of screen, but best focus for f/4 has moved to the left (farther).

Exceptions to above lens types

DC lens examples

Defocus Control (DC) is a name which Nikon uses for special lenses that allow to adjust bokeh type through variable correction of spherical aberration. It is a rare opportunity that allows to study transition between lens type 2 (front creamy), type 1 (neutral) and type 3 (rear creamy), all in one lens.

Nikon Nikkor 105 DC f/2

I have tested this lens with usual bokeh-test-lines.png with focus distance around 1.8m, on tripod, at several apertures and several settings of DC ring on Nikon D90. To keep the DC lens sharp, you should not set front/rear ring to higher number than what you use for aperture. If you fail to do, the DC effect will be stronger but image quality will be worse. In table below images that break this rules are marked with star *.

DC ring position \ Aperture f/2.0 f/2.8 f/4.0
DC F5.6 DC-F5.6 f/2.0 * DC-F5.6 f/2.8 * DC-F5.6 f/4.0 *
DC F4.0 DC-F4.0 f/2.0 * DC-F4.0 f/2.8 * DC-F4.0 f/4.0
DC F2.8 DC-F2.8 f/2.0 * DC-F2.8 f/2.8 DC-F2.8 f/4.0
DC F2.0 DC-F2.0 f/2.0 DC-F2.0 f/2.8 DC-F2.0 f/4.0
DC 0 neutral DC-neutral f/2.0 DC-neutral f/2.8 DC-neutral f/4.0
DC R2.0 DC-R2.0 f/2.0 DC-R2.0 f/2.8 DC-R2.0 f/4.0
DC R2.8 DC-R2.8 f/2.0 * DC-R2.8 f/2.8 DC-R2.8 f/4.0
DC R4.0 DC-R4.0 f/2.0 * DC-R4.0 f/2.8 * DC-R4.0 f/4.0
DC R5.6 DC-R5.6 f/2.0 * DC-R5.6 f/2.8 * DC-R5.6 f/4.0 *

Sample picture based on few entries from table above:

bokeh samples from above table for 105DC

Some notes

Apodization element/filter

Apodization (or apodisation) refers to literally cutting the foot. In optics, it has meaning that sharp transition at bokeh edge is modified. And this modification does not rely on spherical aberration (that is already explained in sections above) thus it does not share disadvantage that under- or over-corrected SA has on sharpness of focused image parts. You can imagine Apodization as aperture blades that would be partly translucent near edge so that there would be a smooth transition. Now I have not seen a lens with partly translucent aperture blades yet. But there are other ways to get this using an apodization lens element or an apodization filter with limitation that it would work best only at largest aperture as the effect will not adapt when the lens is stopped down. In past, only well known lens of this type was Minolta/Sony 135 STF f/2.8 t/4.5 (with apodization element). See here and here. Since fall 2014 there is a Fujifilm XF 56/1.2 APD with apodization filter. Note that Apodization filter/element does not play well with phase detect AF so the 135STF is manual focus and the Fujifilm 56APD focuses in contract detection only (even if camera has phase detect on sensor). And since spring 2016 there is a Laowa 105 STF (f/2 with t/3.2 transmition) that has apodization element.

Apodization filter is a filter placed near aperture blades that is clear in center and gradually darker on sides. It can be made from glass, film or other plastics. I guess it is possible to convert any lens to STF type by including an apodization filter. Best placement is next to aperture blades. Placing such filter on front element may work with long faster lenses, but it will cause high vignetting too. Sample vizualization (Apodization filter has yellow color):

ray traced
        example apodization 1

ray traced
        example apodization 2

If you have successfully converted non-STF lens into STF, write me an email - I will link to your blog about that.
Here is a page of Markus Keinath who has been experimenting with various Apodization filters on different lenses and sent me email with link to his page: http://www.4photos.de/camera-diy/Apodization-Filter.html

Apodization lens element is concave lens that is not made from a clear glass, but rather from kind of gray tinted glass. Rays going through center of this lens element will be attenuated only a bit, but rays going through side will attenuate their light a lot. So effect is same like apodization filter, but it has different set of advantages and disadvantages in terms of lens design compared to buit-in filter.

Note that I have seen some claims that Apodization element/filter creates Gaussian profile of bokeh (like Gaussian blur effect in image editors) and that this bokeh is too smooth. I don't think that it has to be that way. In case of filter, the profile of attenuation transition is a design choice. Also once you stop down the lens a bit, you will get different profile, so even if at some apertures the effect is like the Gaussian filter, when lens is stopped down the bokeh will be less smooth.

There is also a way to simulate Apodization filter by using either multiple exposures with different apertures or by changing aperture during exposure. It is described below.

Apodization - Do it yourself

Do it yourself? I plan to test this, but I have not done it yet. Check this article after few weeks to see if I’m successful with that.

So how to do it? There are several design choices for DYI modification:

Get filter

The first issue is that radial ND filters are not common. Fujifilm marketing talks about nanotechnology stuff “The built-in APD filter, the pinnacle of Fujifilm's nanotechnology, produces even smoother bokeh, making the subject stand out even more and enhances creativity, not only for portraits, but also on a wide range of other subjects.” That does not sound like you could ever make that good APD modification, right? After all Fujifilm sells the APD version for 500 USD more (and that is for regular price, non-APD has often some discounts). Never mind, read on.

The Minolta/Sony 135 STF f/2.8 t/4.5: It does not have filter, it has concave element that is made from “grey” glass. If a ray goes through center, it goes through less thickness thus less attenuating part. If a ray goes through side, it goes through more thickness thus more attenuating part. So that is a nice graduated radial ND filter and a lens in one (actually in 135 STF it is doublet with both air-glass surfaces being flat). Laowa 105 STF is similar. Not an option for DIY solution either.

I know about Marcus Keinath who has successfully converted some manual lenses by adding a APD filter made of appropriately exposed and developed negative film. Read about it here. He also writes, that APD filters can be ordered from here. But I guess they don’t sell them in small quantities with reasonable prices.

Anyway, adding a layer of glass or film with that APD filter is going to affect some optical properties of lens (see here). You may lose some sharpness, especially for big aperture lenses where this modification make most sense.

I don’t have a film stock nor film camera so I decided to pursue different way. My idea is to use a smoke to darken part of lenses. Yes, lenses directly - no additional glass surface added. Will work? I don’t know yet. I have just tried to smoke with candle over a glass bottle and it created nice ND gradient. I don’t have reliable smoke source yet and setup that could produce evan smoke layer around the lens element. Candle smoke only happens when burning is incomplete. The black smoke that deposited on the bottle is not permanent, it can be cleaned almost completely by fingers. So there is a chance that if you do it wrong you can clean lens and start over. There may be some interaction with coatings though. Is deposited smoke fine enough? I don’t know yet.

Where to place it?

Best place is exactly where aperture is. You can certainly remove it and place some filter there at cost of not having aperture ring. This may sound bad, but apodization will be best visible only when lens is wide open so you will be likely to use it there. Also apodization will reduce T-stop so if you have just slight issues on bright day with highest shutter speed and lowest ISO at maximum aperture, it may work a bit better after conversion.

Other compromise is to just place it next to the aperture. It won’t be as good as it can be, but it will make bokeh better. Fujifilm just did that with 56/1.2 APD lens. It has one extra filter. So what is the compromise?

Look at the diagram that shows how light passes through lens. Since I plan to modify Nikon 50/1.8G, this is approximate diagram of it. Rays are just hand-drawn without much accuracy. If you want to see some better diagrams, Pierre Toscani has best visualizations of lenses that I have seen. But he does not describe bokeh effects which are of interest here.

approximate trace of 50/1.8 showing how bokeh is affected by apodization filtere position

You can see that one apodization filter is not enough for most smooth bokeh outside of picture center. One side is smooth but other is not. You can certainly see this in pictures of Fujinon 56 f/1.2 APD here: http://www.randallcipriano.com/2014/12/the-real-difference-xf56-vs-xf56-apd-vs-ff/ and here: http://ivanjoshualoh.wordpress.com/2014/12/13/apd-the-new-king/. On the other hand, I have not seen that in Sony 135 STF. In fact Sony 135 STF is still king of apodization even when compared to newer Laowa 105 STF. You can see it in this comparison. When you look at apodization elements in both lenses in becomes obvious that a profile that Laowa uses is not strong (light going through sides goes through about 2x thickness than light going through center while Sony 135 STF has almost zero thickness in center of apodized element so it can be made from quite dark glass. Laowa seems to have quite bussy bokeh on grass samples in the comparison so I guess the amount of apodization is too weak to attenuate aberrations that affect bokeh. But there is still nice effect on infinity (where SA effect is weak when focusing close).

It is clear that double apodization will be better. Since I plan to apply smoke on lens surfaces, I can apply that on both lenses around aperture. Like here:

approximate trace of 50/1.8 showing how I plan to do DIY apodization

So check this article out in few weeks (or rather years - I did not have time to pursue this further since fall 2014 when I written this part originally) to see what I got in my DIY apodization test. Be aware if you attempt to do this that you will likely lose autofocus and it is quite easy to destroy a lens. So starting with some cheap and manual lens is a good way to go.

In last few years the Fuji with new APD design sparked a new interest in doing apodization of lenses in DYI way. Here are few links:





Outdoor bokeh comparisons

Comparison of Sigma 30/1.4, Sigma 50/1.4, Nikon 50/1.4 on DX and FX

I have taken my Nikon D90 (DX - APS-C frame) and friend's Nikon D3 (FX - full frame) with three prime lenses to Vinohrady cemetery to evaluate their background bokeh. There were two FX lenses: Sigma 50/1.4 DG HSM, Nikon 50/1.8G AF-S; and one DX lens: Sigma 30/1.4 DC HSM. Pictures are jpegs converted by ViewNX in Standard picture mode and each series has fixed white balance. Aperture ranges from wide open to f/4 in four steps.

Position of tripod was fixed, but cameras have different height between mount and bottom plate so there is some change, also while both Sigma 50 and Nikon 50 are marked as 50mm, the Sigma is about 46mm Nikon is slightly longer at 52mm.

Open a few of them in new browser tabs (middle size is enough for bokeh comparisons) and switch between them to compare.

Series 1

Series 1 full album - focus distance around 5m.
Here are links to middle size pictures:

DX Sigma 30/1.4 f/1.4 f/2.0 f/2.8 f/4.0
FX Nikon 50/1.8G f/1.8 f/2.2 f/2.8 f/4.0
FX Sigma 50/1.4 f/1.4 f/2.0 f/2.8 f/4.0
DX Nikon 50/1.8G f/1.8 f/2.2 f/2.8 f/4.0
DX Sigma 50/1.4 f/1.4 f/2.0 f/2.8 f/4.0
Series 1

Series 2 full album - focus distance around 1.5m.
Here are links to middle size pictures:

DX Sigma 30/1.4 f/1.4 f/2.0 f/2.8 f/4.0
FX Nikon 50/1.8G f/1.8 f/2.2 f/2.8 f/4.0
FX Sigma 50/1.4 f/1.4 f/2.0 f/2.8 f/4.0
DX Nikon 50/1.8G f/1.8 f/2.2 f/2.8 f/4.0
DX Sigma 50/1.4 f/1.4 f/2.0 f/2.8 f/4.0

What I see in both series is that Sigma 50/1.4 DG HSM has most smooth bokeh in background out of the three wide open, especially in APS-C subframe. On sides in full frame, the bokeh of Sigma 50 has slightly pronounced edges and it is more of triangle shape. Sigma 30 also has this triangle bokeh on sides, but even in its limited APS-C frame there is a lot of it.

Comparison of Sigma 85/1.4 and Nikon 105DC f/2 on FX

I have taken friend's Nikon D3 (FX - full frame) with these two lenses prime lenses to Vinohrady cemetery to evaluate their background bokeh. Pictures are out of camera jpegs standard picture mode, ISO 200. Aperture ranges from wide open to f/5.6 in four or five steps. Camera was on tripod and used with delayed exposure. Each line in table below was focused wide open and for particular DC value using AF in Live View (on the leaves on the right side) then switched to MF and exited Live View. Exposure was manual.

Lens + setting \ Aperture f/1.4 f/2.0 f/2.8 f/4.0 f/5.6
Sigma 85mm f/1.4 f/2.0 f/2.8 f/4.0 f/5.6
Nikon 105 DC front 4.0 f/2.0 f/2.8 f/4.0 f/5.6
Nikon 105 DC front 2.0 f/2.0 f/2.8 f/4.0 f/5.6
Nikon 105 DC neutral f/2.0 f/2.8 f/4.0 f/5.6
Nikon 105 DC rear 2.0 f/2.0 f/2.8 f/4.0 f/5.6
Nikon 105 DC rear 4.0 f/2.0 f/2.8 f/4.0 f/5.6

Samples based on pictures from above table: samples of Sigma 85/1.4 and Nikon 105DC

As expected, the DC has most effect outside of range recommended for best sharpness. Bokeh of Sigma wide open is very close to Nikon at f/2 with DC set to R2. Nikon at f/2 DC neutral a bit less smooth than Sigma and Nikon at f/2 DC R2. On the other hand Sigma bokeh becomes worse at larger focus distances as can be seen in its separate evaluation on this page (here above).





Somewhat innovative methods to get nice bokeh

I had this idea below, but I found it has been described by others before. For example here near the bottom.

Effect of Electronic First Curtain Shutter (EFCS) on Bokeh

Many cameras that have live view mode use or have option to use Electronic First Curtain Shutter (EFCS) mode. In mechanical shutter mode, there are two shutter curtains. For slow shutter speeds: the first opens, then exposure happens, the second closes (movement in same direction). But for shutter speeds faster than around 1/200s, the speed of curtain is not fast enough so what happens is that even before the first curtain is fully openned the second curtain starts already closing. For fast shutter speeds there is only a small slit between curtains moving over the sensor. EFCS solves problem with liveview where to start exposure with full manual shutter the shutter needs to close first (it was open for live view). That additional movement makes shutter less responsive to user input and also shakes camera more before exposure starts. EFCS replaces the first curtain by electronic sensor row reset. For fast shutter speeds this also forms a slit moving over sensor.

This is just a lens that projects bright point in the scene (right side) towards camera (left side, camera not present yet):
lens projecting a bright point

Now add a sensor to the camera side that is at location where rays are not converging, i.e. where light source is not focused:
lens projecting a bright point, there is a sensor in the
	way
Notice how bottom part and top part of the bokeh ball is caused by rays that do not approach sensor perpendicularly.

Last image shows what happens to the exposure when one curtain is directly at the sensor and the other is in front of it. The effect is highest when slit is smallest (highest shutter speed). It shows that exposure is affected by light direction.
how shutter curtains at different location pass ray on to
	sensor depending on angle of ray

External Links

Some articles that go deeper into character of bokeh than just tell the rules for size of bokeh:

Back to index - Jakub Trávník's resources.