"How does background blur (bokeh) relate to sensor size?"
Short answer: A larger sensor has a larger circle of confusion, an important consideration in calculating the depth of field (DOF), and thus causes a larger aperture (bigger opening) to have a sufficiently shallow DOF so as to allow the blurring of point sources (small lights) in the background; creating an effect which is often (incorrectly) called bokeh.
There is little difference, which I detail later, given appropriate adjustments to maintain similar framing.
Bokeh is a blur that can also occur in the foreground and need not be restricted to distant light bulbs though some restrict the usage of that term to only those conditions. It is easier to judge the quality of bokeh by looking at points of light in the background and seeing if they look like round smooth disks, the background isn't the only location where bokeh occurs.
The term bokeh comes from the Japanese word boke (暈け or ボケ), which means "blur" or "haze", or boke-aji (ボケ味), the "blur quality". [Note: It has nothing to do with tiny lights or background vs. foreground, it is the quality of the blurring outside of the depth of field. Conversely, focus is the sharpness within the depth of field, particularly at the focal point].
Now aren't you glad that was the short version.
Image taken using a Nikon 200.0 mm f/2.0 on a Nikon D700, arguably one of the better bokeh producing lenses for photography. Credit: Dustin Diaz.
License: Attribution-NonCommercial-NoDerivs 2.0 Generic (CC BY-NC-ND 2.0)
Finding a less expensive lens is easy and many like these lenses: Hexanon AR 135/3.2, Pentacon 135/2.8, Rokkor 135/2.8, Trioplan 100/2.8, Vivitar 135/2.8, the fact is that the bokeh produced by any of those is more (politely) creative as opposed to quality and you'll need an adapter along with cropping if using a large sensor. A small sensor and an inexpensive lens can produce pleasing results for some (many?).
The mark of so-called perfect bokeh is that point sources will produce round saucers without any rings or aberrations on the disk and gradual falloff at the edge. The disks should be round from edge to edge of the image frame with a spherical lens.
While anamorphic lenses produce characteristic oval bokeh.
Let's define a few things before we get into a much longer explanation.
Background: The area behind the subject of the image.
Foreground: The area in front of the subject of the image.
Blur: To cause imperfection of vision, to make indistinct or hazy, to obscure. The antonym of sharpen.
Bokeh: The quality of the blurring of the out of focus areas of the image outside of the depth of field when the lens is correctly focused on the subject.
Circle of confusion: In idealized ray optics rays are assumed to converge to a point when perfectly focused, the shape of a defocus blur spot from a lens with a circular aperture is a hard-edged circle of light. A more general blur spot has soft edges due to diffraction and aberrations (Stokseth 1969, paywall; Merklinger 1992, accessible), and may be non-circular due to the aperture shape.
Recognizing that real lenses do not focus all rays perfectly under even the best conditions, the term circle of least confusion is often used for the smallest blur spot a lens can make (Ray 2002, 89), for example by picking a best focus position that makes a good compromise between the varying effective focal lengths of different lens zones due to spherical or other aberrations.
The term circle of confusion is applied more generally, to the size of the out-of-focus spot to which a lens images an object point. It relates to 1. visual acuity, 2. viewing conditions, and 3. enlargement from the original image to the final image. In photography, the circle of confusion (CoC) is used to mathematically determine the depth of field, the part of an image that is acceptably sharp.
Depth of field: The distance between the nearest and farthest objects in a scene that appear acceptably sharp in an image. Although a lens can precisely focus at only one distance at a time, the decrease in sharpness is gradual on each side of the focused distance, so that within the DOF, the unsharpness is imperceptible under normal viewing conditions.
Photography: In photography the sensor size is measured based upon the width of film or the active area of a digital sensor. The name 35 mm originates with the total width of the 135 film, the perforated cartridge film which was the primary medium of the format prior to the invention of the full frame DSLR. The term 135 format remains in use. In digital photography, the format has come to be known as full frame. While the actual size of the usable area of photographic 35 mm film is 24w×36h mm the 35 millimeters refers to the dimension 24 mm plus the sprocket holes (used to advance the film).
Video: Sensor sizes are expressed in inches notation because at the time of the popularization of digital image sensors they were used to replace video camera tubes. The common 1" circular video camera tubes had a rectangular photo sensitive area about 16 mm diagonal, so a digital sensor with a 16 mm diagonal size was a 1" video tube equivalent. The name of a 1" digital sensor should more accurately be read as "one inch video camera tube equivalent" sensor. Current digital image sensor size descriptors are the video camera tube equivalency size, not the actual size of the sensor. For example, a 1" sensor has a diagonal measurement of 16 mm.
Subject: The object that you intend to capture an image of, not necessarily everything that appears in frame, certainly not Photo Bombers, and often not objects appearing in the extreme fore and backgrounds; thus the use of bokeh or DOF to defocus objects which are not the subject.
Modulation Transfer Function (MTF) or Spatial Frequency Response (SFR): The relative amplitude response of an imaging system as a function of input spatial frequency. ISO 12233:2017 specifies methods for measuring the resolution and the SFR of electronic still-picture cameras. Line pairs per millimeter (lp/mm) was the most common spatial frequency unit for film, but cycles/pixel (C/P) and line widths/picture height (LW/PH) are more convenient for digital sensors.
Now the we have our definitions out of the way ...
CoC (mm) = viewing distance (cm) / desired final-image resolution (lp/mm) for a 25 cm viewing distance / enlargement / 25
For example, to support a final-image resolution equivalent to 5 lp/mm for a 25 cm viewing distance when the anticipated viewing distance is 50 cm and the anticipated enlargement is 8:
CoC = 50 / 5 / 8 / 25 = 0.05 mm
Since the final-image size is not usually known at the time of taking a photograph, it is common to assume a standard size such as 25 cm width, along with a conventional final-image CoC of 0.2 mm, which is 1/1250 of the image width. Conventions in terms of the diagonal measure are also commonly used. The DoF computed using these conventions will need to be adjusted if the original image is cropped before enlarging to the final image size, or if the size and viewing assumptions are altered.
Using the “Zeiss formula”, the circle of confusion is sometimes calculated as d/1730 where d is the diagonal measure of the original image (the camera format). For full-frame 35 mm format (24 mm × 36 mm, 43 mm diagonal) this comes out to be 0.025 mm. A more widely used CoC is d/1500, or 0.029 mm for full-frame 35 mm format, which corresponds to resolving 5 lines per millimeter on a print of 30 cm diagonal. Values of 0.030 mm and 0.033 mm are also common for full-frame 35 mm format. For practical purposes, d/1730, a final-image CoC of 0.2 mm, and d/1500 give very similar results.
Criteria relating CoC to the lens focal length have also been used. Kodak (1972), 5) recommended 2 minutes of arc (the Snellen criterion of 30 cycles/degree for normal vision) for critical viewing, giving CoC ≈ f /1720, where f is the lens focal length. For a 50 mm lens on full-frame 35 mm format, this gave CoC ≈ 0.0291 mm. This criterion evidently assumed that a final image would be viewed at “perspective-correct” distance (i.e., the angle of view would be the same as that of the original image):
Viewing distance = focal length of taking lens × enlargement
However, images seldom are viewed at the “correct” distance; the viewer usually doesn't know the focal length of the taking lens, and the “correct” distance may be uncomfortably short or long. Consequently, criteria based on lens focal length have generally given way to criteria (such as d/1500) related to the camera format.
This COC value represents the maximum blur spot diameter, measured at the image plane, which looks to be in focus. A spot with a diameter smaller than this COC value will appear as a point of light and, therefore, in focus in the image. Spots with a greater diameter will appear blurry to the observer.
DOF is not symmetrical. This means that the area of acceptable focus does not have the same linear distance before and after the focal plane. This is because the light from closer objects converges at a greater distance aft of the image plane than the distance that the light from farther objects converges prior to the image plane.
At relatively close distances, the DOF is nearly symmetrical, with about half of the focus area existing before the focus plane and half appearing after. The farther the focal plane moves from the image plane, the larger the shift in symmetry favoring the area beyond the focal plane. Eventually, the lens focuses at the infinity point and the DOF is at its maximum dissymmetry, with the vast majority of the focused area being beyond the plane of focus to infinity. This distance is known as the “hyperfocal distance” and leads us to our next section.
Hyperfocal distance is defined as the distance, when the lens is focused at infinity, where objects from half of this distance to infinity will be in focus for a particular lens. Alternatively, hyperfocal distance may refer to the closest distance that a lens can be focused for a given aperture while objects at a distance (infinity) will remain sharp.
The hyperfocal distance is variable and a function of the aperture, focal length, and aforementioned COC. The smaller you make the lens aperture, the closer to the lens the hyperfocal distance becomes. Hyperfocal distance is used in the calculations used to compute DOF.
There are four factors that determine DOF:
- Circle of confusion (COC)
- Aperture of the lens
- Lens focal length
- Focus distance (distance between lens and subject)
DOF = Far Point – Near Point
DOF simply tells the photographer at what distances before and aft of the focus distance that blurriness will occur. It does not specify how blurry or what “quality” those areas will be. The design of the lens, the design of the diaphragm, and your background define the characteristics of the blur—its intensity, texture, and quality.
The shorter the focal length of your lens is, the longer the DOF.
The longer the focal length of your lens is, the shorter the DOF.
If sensor size does not appear anywhere in these formulas, how does it alter the DOF?
There are several sneaky ways that format size sneaks into the DOF math:
Subject-to-camera / focal distance
It's because of the crop factor and the resulting focal length along with the necessary aperture for the light gathering ability of the sensor that gives the greatest affect upon your calculations.
A higher resolution sensor and a better quality lens will produce better bokeh but even a cellphone sized sensor and lens can produce reasonably acceptable bokeh.
Using the same focal length lens on an APS-C and full frame camera at the same subject-to-camera distance produces two different image framings and causes the DOF distance and thickness (depth, of the field) to differ.
Switching lenses or changing subject-to-camera in accordance with the crop factor when switching between an APS-C and full frame camera to maintain identical framing results in a similar DOF. Moving your position to maintain identical framing slightly favors the full frame sensor (for a greater DOF), it's only when changing lenses to match the crop factor and maintain framing that the larger sensor gains a narrower DOF (and not by much).
It's the aperture advantage that makes the full frame sensor a better and more expensive choice both for camera and lenses and often for features (FPS not being one of them, nor size and weight).
Going to a medium sized sensor over a tiny sensor further advantages the larger sensor but bokeh likely isn't the best use case to justify 20x+ times price difference.
The greater number of pixels per dot of light certainly will produce smoother bokeh but so would moving closer with a small sensor camera. You can charge proportionality more for use of more expensive equipment if you make money off of your photos or videos, otherwise a bit of footwork or additional lower cost lenses will save you a lot of money over investing in a larger format system.
Wikipedia section: Foreground and background blur.
Check out this article "Staging Foregrounds" by R.J. Kern on foreground blur, which includes many photos with background and foreground blur.
B&H has a 3 part article on DOF: Depth of Field, Part I: The Basics, Part II: The Math and Part III: The Myths.
Most importantly, "bokeh" isn't simply "background blur" but all blur outside the DOF; even in the foreground. It's that small lights at a distance are easier to judge bokeh quality.