A Gaussian Blur is a general purpose blur filter. This removes fine image detail and noise leaving only larger scale changes. Gaussian Blurs produce a very pure smoothing effect without side effects.

A Gaussian Blur is distinct from other blurs in that it has a well defined effect on different levels of detail within an image. As the level of detail becomes smaller the filter lets through less and less. With other types of blur (e.g. Mean Filter) the amount let through may vary considerably.

As well as having this well defined and consistent frequency response, certain characteristics of the Gaussian function mean that large blurs can be applied much faster than other similar kinds of filters.

Syntax

[C#]

static void GaussianBlur(Bitmap bitmap, double radius);

[Visual Basic]

Shared Sub GaussianBlur(bitmap As Bitmap, radius As Double)
Params
Name Description
bitmap The bitmap to process
radius This value represents the standard deviation of the Gaussian function. Low values remove only very fine detail while high values remove larger levels of detail.
Notes

None.

Example

[C#]using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/pedro-lastra-Nyvq2juw4_o-unsplash.jpg"))) {
  Effects.GaussianBlur(bm, 1);
  bm.Save(Server.MapPath("IG8_Effects_GaussianBlur1.jpg"));
}
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/pedro-lastra-Nyvq2juw4_o-unsplash.jpg"))) {
  Effects.GaussianBlur(bm, 2);
  bm.Save(Server.MapPath("IG8_Effects_GaussianBlur2.jpg"));
}
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/pedro-lastra-Nyvq2juw4_o-unsplash.jpg"))) {
  Effects.GaussianBlur(bm, 5);
  bm.Save(Server.MapPath("IG8_Effects_GaussianBlur3.jpg"));
}


Here we apply a Gaussian blur effect with different radii. Ouput files are shown below.


pedro-lastra-Nyvq2juw4_o-unsplash.jpg


IG8_Effects_GaussianBlur1.jpg


IG8_Effects_GaussianBlur2.jpg


IG8_Effects_GaussianBlur3.jpg