I have heard multiple times in photography, the words Bokeh, and Gaussian Blur. To me, it seems that the words are used almost interchangeably, but in some instances, I have heard them contrasted. What's the difference, and what are the definitions of each of them?
Bokeh is specifically the out-of-focus areas of an image. Gaussian blur is an algorithm to fog selected image areas, to hide details or make them look out of focus.
The main differences:
- bokeh is created optically, gaussian blur in post-production;
- in bokeh, the amount of how wide an out-of-focus point will be smeared is determined by its relative distance from focal plane, whereas gaussian blur is applied to a two-dimensional image where no distance information is present, thus all points are smeared equally;
- in bokeh, the smearing characteristics depend on configuration and aperture shape of the lens, whereas gaussian blur is always smooth;
- a small light source will be rendered as an aperture-shaped figure with quite well-defined edges in bokeh; but gaussian blur renders it as a spot with fading edges;
- in bokeh, noise is present at the same level as in in-focus parts of image with same luminance; gaussian blur kills noise, so there'll be less noise than in non-blurred parts of image;
- in bokeh, light areas will dominate over dark ones, while gaussian blur gives preserves the ratio of dark-light areas.
A sign in a train station, taken with f/10 (giving deep depth of field).
Gaussian blur performed on background parts of the previous image.
A sign in a train station, taken with f/2.8 (giving shallow depth of field and natural bokeh).
So, all in all, you can use one to fake another, but the result will be similar only for low-noise bokeh containing items on roughly a plane parallel to focal plane, not including any significantly lighter areas or light sources, and taken with a lens that has a smooth bokeh.
Bokeh means the visual looks of out-of-focus areas of a photograph taken using real world optics. For perfect optics an out of focus point of light (e.g. an out of focus start) would be a perfect disc. Real world optics are not perfect and a single point of light will not show up as a perfect disc in the photograph.
Bokeh is often considered better or smoother when it's closer to theoretically perfect result. Typical errors include showing ring or malformed ellipse instead of a disk for a given point source object.
Gaussian blur is a digital filter that is easy to compute and looks somewhat similar to out of focus image. However, Gaussian blur does not output a disc for a single point of light in the input but instead a blurred blob with no distinct border.
Here's a visualization of the difference (created with Gimp):
Out of focus can be emulated with digital filters, too. Technically this is called convolution and its reverse is called deconvolution. There exists even algorithms called blind deconvolution where a piece of computer software first computes estimated deconvolution filter and then applies the filter. And the near-magical part is that the deconvolution filter computed this way can remove camera shake and re-focus incorrectly focused image – to a degree. The process is seriously limited by the noise from the digitizer (e.g. CMOS sensor). Basically the algorithm tries to estimate the error appearing over the whole image (e.g. everything is blurred) and computes filter that reverses the error by maximizing the signal. Of course, that also includes maximizing noise in the input.
The case where digital post-production cannot match using real optics is when the original scene has high dynamic range the and the source image going to post-production cannot contain enough dynamic range. This happens because a very bright light spot should create bright disc when it's out of focus. However, with limited range for input image, a simulated out of focus filter cannot create the missing original intensity for the disc and as a result the disc will look very dull compared to real image taken with real (high quality) optics.
If one could have an image sensor with very low noise and high dynamic range combined with a small lens (e.g. a smart phone), it would be possible to emulate current state of art high quality lens with a big sensor. Unfortunately, we currently do not have any technology to create an imaging sensor that has low noise and high dynamic range combined with high resolution and the last part is required for any small lens. Most modern smartphone cameras have pretty high noise and low dynamic range because marketing department wants high resolution above all the other features.