Skip to content
CoreSource checked

Gaussian Blur

Smooths an image by convolving it with a Gaussian kernel.

Quick Facts

Compact metadata for implementation and discovery.

Category
Image Processing
Difficulty
Beginner
Family
Smoothing Filter
Tier
Core
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
17
Code example
Ready
Visualization
Ready

Overview

Gaussian blur replaces each pixel with a weighted neighborhood average where nearby pixels receive more weight. It suppresses high-frequency noise and is separable into horizontal and vertical passes.

Core Concepts

Gaussian kernelweighted averageseparable filternoise smoothingpixel operationfilter kernelsmoothing filterpixel neighborhood

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(w h k)

Average

O(w h k)

Worst

O(w h k)

Space

O(w h)

When to Use

  • Use when local averaging should favor nearby pixels smoothly.
  • Use when a separable, predictable low-pass filter is appropriate.

When Not to Use

  • Avoid when preserving sharp edges is more important than noise reduction.
  • Avoid when blur radius and border behavior cannot be chosen consistently.

What It Does

  • Builds or samples a Gaussian kernel
  • Convolves the image with normalized weights
  • Reduces noise and fine detail

Use Cases

  • Preprocessing before edge or feature detection
  • Scale-space construction
  • Softening images or suppressing pixel noise

Inputs

  • Image
  • Blur radius or sigma

Outputs

  • Blurred image

Key Formulas (1)

Gaussian weight

G(x) = exp(−(x2) / (2 · σ2))
G(x) = exp(-(x^2) / (2 * sigma^2))

Assigns stronger weight to nearby samples than distant samples.

Pseudocode

  1. 1.Choose sigma and kernel radius
  2. 2.Compute normalized Gaussian weights
  3. 3.Convolve each row with the 1D kernel
  4. 4.Convolve each column with the same 1D kernel
  5. 5.Return the smoothed image

Canonical Example

Input
1D row [0, 0, 10, 0, 0] with a small Gaussian kernel
Output
a row where the central spike is spread into neighboring pixels
Explanation
The Gaussian weights distribute the spike while preserving the total intensity when normalized.

Implementation Notes

  • Normalize kernel weights so they sum to one.
  • Use separable horizontal and vertical convolution for performance.
  • Test with an impulse image to verify kernel shape and centering.

Common Pitfalls

  • Forgetting to normalize the kernel changes image brightness.
  • Using inconsistent border handling changes edge pixels.
  • Large kernels are expensive unless separability or approximation is used.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show a weighted kernel softening sharp pixel changes.

Gaussian Blur mechanism walkthrough step 1 of 5
Step 1 of 5: Choose sigma and kernel radius
blur-kernel

Notes

Gaussian blur is often used as a controlled low-pass filter before measuring gradients.

Sources (1)

What each reference supports for this entry.

Digital Image Processing

Book

Image-processing textbook support for Gaussian Blur's pixel-neighborhood operations, filtering rules, and image-analysis role.

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Often paired withCanny Edge Detection

Canny uses Gaussian smoothing before edge-gradient measurement.

Conceptual neighborImage Pyramid

Image pyramids often combine smoothing with downsampling.

Tags

Image ProcessingSmoothingFiltering