Gaussian Blur (2024)

Gaussian blur describes blurring an image by aGaussian function. It is a widelyused effect in graphics software, typically to reduce image noise and reducedetail. The visual effect of this blurring technique is a smoothblur resembling that of viewing the image through a translucent screen, distinctlydifferent from the bokeheffect produced by an out-of-focus lens or the shadow of an objectunder usual illumination. Gaussian smoothing is also used as apre-processing stage in computer vision algorithms in order toenhance image structures at different scales—see scale-space representation and scale-spaceimplementation.

Mathematically, applying a Gaussian blur to an image is the sameas convolvingthe image with a Gaussian function; this is also knownas a two-dimensional Weierstrass transform. Bycontrast, convolving by a circle (i.e., a circular box blur) would moreaccurately reproduce the bokeh effect. Since the Fouriertransform of a Gaussian is another Gaussian, applying aGaussian blur has the effect of reducing the image's high-frequencycomponents; a Gaussian blur is thus a low passfilter.

Mechanics

The Gaussian blur is a type of image-blurring filter that uses aGaussian function (which is also used for the normaldistribution in statistics) for calculating the transformation to apply toeach pixel in the image. The equation of a Gaussian function in onedimension is

G x y = 1 2 π σ e - x 2 2 σ 2

In two dimensions, it is the product of two such Gaussians, oneper direction:

G x y = 1 2 π σ 2 e - x 2 + y 2 2 σ 2

Where x is the distance from the origin in thehorizontal axis, y is the distance from the origin in thevertical axis, and σ is the standard deviation of theGaussian distribution. When applied in two dimensions, this formulaproduces a surface whose contours are concentriccircles with a Gaussian distribution from the center point.Values from this distribution are used to build a convolution matrix whichis applied to the original image. Each pixel's new value is set toa weighted average of that pixel'sneighborhood. The original pixel's value receives the heaviestweight (having the highest Gaussian value) and neighboring pixelsreceive smaller weights as their distance to the original pixelincreases. This results in a blur that preserves boundaries andedges better than other, more uniform blurring filters; see alsoscale-spaceimplementation.

In theory, the Gaussian function at every point on the imagewill be non-zero, meaning that the entire image would need to beincluded in the calculations for each pixel. In practice, whencomputing a discrete approximation of the Gaussian function, pixelsat a distance of more than 3σ are small enough to beconsidered effectively zero. Thus contributions from pixels outsidethat range can be ignored. Typically, an image processing programneed only calculate a matrix with dimensions 6σ+6σ (where is the ceiling function) to ensurea result sufficiently close to that obtained by the entire gaussiandistribution.

In addition to being circularly symmetric, the Gaussian blur canbe applied to a two-dimensional image as two independentone-dimensional calculations, and so is termed linearlyseparable. That is, the effect of applying the two-dimensionalmatrix can also be achieved by applying a series ofsingle-dimensional Gaussian matrices in the horizontal direction,then repeating the process in the vertical direction. Incomputational terms, this is a useful property, since thecalculation can be performed in O ( w kernel w image h image ) + O ( h kernel w image h image ) time (where h is height and w iswidth; see Big O notation), as opposed to O ( w kernel h kernel w image h image ) for a non-separable kernel.

Applying multiple, successive gaussian blurs to an image has thesame effect as applying a single, larger gaussian blur, whoseradius is the square root of the sum of the squares of the blurradii that were actually applied. For example, applying successivegaussian blurs with radii of 6 and 8 gives the same results asapplying a single gaussian blur of radius 10, since 6 2 + 8 2 = 10 . Because of thisrelationship, processing time cannot be saved by simulating agaussian blur with successive, smaller blurs — the time requiredwill be at least as great as performing the single large blur.

Gaussian blurring is commonly used when reducing the size of animage. When downsampling an image, it is common toapply a low-pass filter to the image prior to resampling. This isto ensure that spurious high-frequency information does not appearin the downsampled image (aliasing). Gaussian blurs have niceproperties, such as having no sharp edges, and thus do notintroduce ringing into the filtered image.

Low-pass filter

Gaussian blur is a low-pass filter, attenuating highfrequency signals.

Its amplitude Bodeplot (the log scale in the frequency domain) is a parabola.

Sample Gaussian matrix

This is a sample matrix, produced by sampling the Gaussian filterkernel (with σ = 0.84089642) at the midpoints of each pixel and thennormalising. Note that the center element (at [4, 4]) has the largestvalue, decreasing symmetrically as distance from the center increases.

( 0.000000670.000022920.000191170.000387710.000191170.000022920.000000670.000022920.000786330.006559650.013303730.006559650.000786330.000022920.000191170.006559650.054721570.110981640.054721570.006559650.000191170.000387710.013303730.110981640.225083520.110981640.013303730.000387710.000191170.006559650.054721570.110981640.054721570.006559650.000191170.000022920.000786330.006559650.013303730.006559650.000786330.000022920.000000670.000022920.000191170.000387710.000191170.000022920.00000067 )

Note that 0.22508352 (the central one) is 1177 times larger than 0.00019117 which is just outside 3σ.

Implementation

A Gaussian Blur effect is typically generated by convolving animage with a kernel of Gaussian values. In practice, it is best totake advantage of the Gaussian Blur’s linearly separable propertyby dividing the process into two passes. In the first pass, aone-dimensional kernel is used to blur the image in only thehorizontal or vertical direction. In the second pass, anotherone-dimensional kernel is used to blur in the remaining direction.The resulting effect is the same as convolving with atwo-dimensional kernel in a single pass, but requires fewercalculations.

Discretisation is typically achieved by sampling the Gaussianfilter kernel at discrete points, normally at positionscorresponding to the midpoints of each pixel. This reduces thecomputational cost but, for very small filter kernels, pointsampling the Gaussian function with very few samples leads to alarge error. In these cases, accuracy is maintained (at a slightcomputational cost) by integration of the Gaussian function overeach pixel's area.

When converting the Gaussian’s continuous values into thediscrete values needed for a kernel, the sum of the values will bedifferent from 1. This will cause a darkening or brightening of theimage. To remedy this, the values can be normalized by dividingeach term in the kernel by the sum of all terms in the kernel.

Gaussian Blur (2024)

FAQs

Gaussian Blur? ›

What is Gaussian blurring? Named after mathematician Carl Friedrich Gauss (rhymes with “grouse”), Gaussian (“gow-see-an”) blur is the application of a mathematical function to an image in order to blur it. “It's like laying a translucent material like vellum on top of the image,” says photographer Kenton Waltz.

What is the Gaussian blur concept? ›

In a Gaussian blur, the pixels nearest the centre of the kernel are given more weight than those far away from the centre. The rate at which this weight diminishes is determined by a Gaussian function, hence the name Gaussian blur. A Gaussian function maps random variables into a normal distribution or “Bell Curve”.

What is the difference between blur and Gaussian blur? ›

While the Gaussian blur is slightly slower than a simple average blur (and only by a tiny fraction), a Gaussian blur tends to give much nicer results, especially when applied to natural images.

What is the benefit of Gaussian blur? ›

The blur makes the image less sharp, but prevents the formation of aliasing artifacts. Gaussian blurring is commonly used when reducing the size of an image. When downsampling an image, it is common to apply a low-pass filter to the image prior to resampling.

How does Gaussian blur reduce noise? ›

The main goal of this project is to design a filter to smoothen the given image based on Gaussian blur technique. Image Blurring or image smoothening is a technique of averaging the group of pixels in order to reduce noise and sharpness at the edges.

What are the disadvantages of Gaussian blur? ›

The size of the Gaussian kernel depends on the noise level in the image. If the kernel size is too large, small features within the image may get suppressed, and the image may look blurred. Hence, the quality of the details of the image will be affected.

Can Gaussian blur be reversed? ›

Yes. Though that's just a corollary of doing better when you know something about the probability distribution of inputs.

What is the math of Gaussian blur? ›

Because a photograph is two-dimensional, Gaussian blur uses two mathematical functions (one for the x-axis and one for the y) to create a third function, also known as a convolution. This third function creates a normal distribution of those pixel values, smoothing out some of the randomness.

What is the alternative to Gaussian blur? ›

If you're specifically referring to Drop Shadows, you could just use the Drop Shadow effect instead of the Gaussian Blur effect. Since Drop Shadow is a native Illustrator effect instead of a Photoshop effect, the blur radius in Drop Shadow is expressed as a distance, not a number of pixels.

Is Gaussian blur an algorithm? ›

There are many algorithms to implement blur, one of them is called Gaussian Blur Algorithm. It utilizes Gaussian distribution to process images. This article is to introduce Gaussian Blur algorithm, you will find this is a simple algorithm. In fact, it is a kind of data smoothing which can be used in many situations.

How do you apply the Gaussian blur effect? ›

Select the layer you want to apply a filter to, then select the [Filter] menu > [Blur] > [Gaussian blur] to open the dialog box. This smooths out the image. You can specify the strength of the blur. To learn how to apply a [Blur] effect to a layer, see "Using the Blur Filters".

Is Gaussian blur random? ›

Blurs image with randomly chosen Gaussian blur kernel. The convolution will be using reflection padding corresponding to the kernel size, to maintain the input shape.

What is the difference between lens and Gaussian blur? ›

”Lens Blur” creates bokeh effect without losing the object outlines completely. Glowing lights are expressed as round bokeh effect, so you can still recognize the objects and scenery. ”Lens Blur” processing is heavier than “Gaussian Blur”, however it creates a dramatic and beautiful background effect.

Why is it called a Gaussian blur? ›

In image processing, a Gaussian blur (also known as Gaussian smoothing) is the result of blurring an image by a Gaussian function (named after mathematician and scientist Carl Friedrich Gauss). It is a widely used effect in graphics software, typically to reduce image noise and reduce detail.

Does Gaussian blur affect smart object? ›

Gaussian blur, like any other filter in Photoshop, can be removed or adjusted if applied non-destructively. We recommend using adjustment layers, layer masks, and smart objects to apply the Gaussian blur effect so it can be easily edited or removed later.

What is the difference between box blur and Gaussian blur? ›

Box Blur is similar to Fast Blur and Gaussian Blur, but Box Blur has the added advantage of an Iterations property, which allows you to control the quality of the blur.

What is the Gaussian process easily explained? ›

A Gaussian process represents a distribution over functions by specifying a multivariate normal (Gaussian) distribution over all possible function values. It is possible to easily manipulate Gaussian distributions to find the distribution of one function value based on the values of any set of other values.

What is the purpose of the Gaussian filter? ›

It is used to remove Gaussian noise and is a realistic model of defocused lens. Sigma defines the amount of blurring. The radius slider is used to control how large the template is. Large values for sigma will only give large blurring for larger template sizes.

What is Gaussian model used for? ›

A Gaussian mixture model is a machine learning method used to determine the probability each data point belongs to a given cluster. The model is a soft clustering method used in unsupervised learning.

Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 5807

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.