The Gaussian filter is arguably the most important single operation in image processing. As Gonzalez and Woods note, spatial filtering through convolution is the foundation of most image processing operations.
Convolution Mechanics
A filter kernel slides across the image; at each position, the output pixel equals the sum of products of kernel coefficients and underlying pixel values: g(x,y) = Σ w(s,t) · f(x+s, y+t). The Gaussian kernel's coefficients are computed from the Gaussian function, normalized to sum to 1.
Comparison with Other Smoothing Filters
Box (averaging) filter: All coefficients equal. Simpler and faster, but blurs edges aggressively and produces frequency-domain ringing. Objects smaller than half the mask area are eliminated entirely.
Weighted average: Center weighted highest (e.g., 3×3 with center=4, orthogonal=2, diagonal=1, all ÷16). An approximation of the Gaussian for small kernels.
Gaussian: Coefficients follow exp(-D²/2σ²). Separable. Smooth frequency response with no ringing. The standard choice for noise reduction.
Border Handling
At image borders, the kernel extends beyond the image. Options include: zero-padding (treats outside as black), replicate border pixels, wrap around, or process only the valid interior region. The BOM allows selection of the border handling method.
Relationship to PSF
In fluorescence microscopy, the optical point spread function (PSF) is approximately Gaussian. Convolution with a Gaussian kernel therefore models the optical blurring inherent in the imaging system — understanding this connection helps set appropriate sigma values relative to the optical resolution.
The Gaussian filter is special among smoothing filters because it is the mathematically smoothest way to blur an image. Unlike a simple average (box filter) that treats all neighbors equally and creates blocky artifacts, the Gaussian weights neighbors by distance, producing natural-looking smoothing. It's also computationally efficient because it can be split into two fast 1D passes instead of one slow 2D pass.