9
$\begingroup$

Applying multiple Gaussian blurs can result in an effect that is equivalent to a stronger Gaussian blur.

For instance this question says that: Is doing multiple Gaussian blurs the same as doing one larger blur?

Wikipedia also says it, but says that it will always be just as many calculations or more to do it in multiple blurs versus doing it in a single blur.

Applying multiple, successive gaussian blurs to an image has the same effect as applying a single, larger gaussian blur, whose radius is the square root of the sum of the squares of the blur radii that were actually applied. For example, applying successive gaussian blurs with radii of 6 and 8 gives the same results as applying a single gaussian blur of radius 10, since \sqrt{6^2 + 8^2} = 10. Because of this relationship, processing time cannot be saved by simulating a gaussian blur with successive, smaller blurs — the time required will be at least as great as performing the single large blur.

Source: https://en.wikipedia.org/wiki/Gaussian_blur#Mechanics

However, I've heard and read about people doing multiple blurs in realtime graphics to achieve a stronger blur.

What benefit is there if it isn't a reduction in computation?

$\endgroup$
  • 3
    $\begingroup$ Are you sure they were talking about multiple gaussian blurs? Doing several Box blurs is a common way to approximate a gaussian blur. $\endgroup$ – yuriks Aug 17 '15 at 17:26
  • $\begingroup$ Interesting info. I believe so, yes, but could be mistaken! $\endgroup$ – Alan Wolfe Aug 17 '15 at 17:32
  • 1
    $\begingroup$ It may be simpler just to sample neighboring pixels, its also much more intuitive as a physical model of diffusion, see 12 steps to Navier-Stokes, step 7 $\endgroup$ – joojaa Aug 17 '15 at 18:41
13
+50
$\begingroup$

There are two cases I can think of where multiple blurs would be performed in succession on a single image.

First, when performing a large-radius blur, it may reduce the total computation if you first downsample the image (which is a blur) and then perform a smaller-radius blur on the downsampled image. For example, downsampling an image by 4x and then performing a 10px-wide Gaussian blur on the result would approximate performing a 40px-wide Gaussian blur on the original—but is likely to be significantly faster due to improved locality in sampling and fewer samples taken overall.

Box approximation of a wide Gaussian

The initial downsampling filter is often simply a box (as shown above), but it can also itself be something more sophisticated, such as a triangle or bicubic filter, in order to improve the approximation.

Mitchell-Netravali approximation of a wide Gaussian

This is a Mitchell-Netravali (cubic) downsample followed by a Gaussian. Interestingly, it turns out that using a Gaussian for the initial downsampling doesn't make such a great approximation if your goal is to use it to produce a larger Gaussian.

An initial downsampling step is also frequently used when implementing visual effects like depth of field and motion blur, for similar reasons.

A second reason to perform multiple Gaussian blurs is to approximate a non-separable filter by blending between various Gaussians of different radii. This is commonly used in bloom, for example. The standard bloom effect works by first thresholding to extract bright objects from the image, then creating several blurred copies of the bright objects (usually using the downsample-then-blur technique just discussed), and finally weighting and summing them together. This allows artists a greater level of control over the final shape and appearance of the bloom.

Sum of three Gaussians creates a "heavy-tailed" function

Here, for example, is a weighted sum of three Gaussians (red line) which produces a shape that's more narrowly peaked and heavier-tailed than a single Gaussian (blue line). This is a popular sort of configuration to use for bloom, as the combination of a narrow, bright center with a wide, diffuse halo is visually appealing. But since this kind of filter shape isn't separable, it's cheaper to make it out of a mixture of Gaussians than to try to filter with it directly.

Another variation on this idea is the concept of a diffusion profile used with subsurface scattering for skin rendering. Different blur radii may be used for the red, green, and blue channels to approximate the way different wavelengths of light scatter differently, as in GPU Gems 3 skin shading chapter by Eugene d'Eon and Dave Luebke. In fact, that paper uses a mixture of seven different Gaussians, with different R, G, and B weights for each, to approximate the complicated non-separable, wavelength-dependent scattering response of human skin.

Diffusion profiles from GPU Gems 3 article on skin shading

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.