Blur Bitmap
Apply Box, Gaussian, or Stack blur to any bitmap image directly in your browser. Adjust radius, preview in real time, and export full-resolution results.
About
Spatial blurring is a low-pass filter operation that attenuates high-frequency components in a raster image. A miscalculated kernel radius or an inappropriate algorithm choice produces either imperceptible smoothing or destructive loss of structural detail. This tool implements three distinct convolution strategies - Box, Gaussian (approximated via 3-pass box accumulation per the Central Limit Theorem), and Stack Blur (Klingemann's weighted-stack method) - operating on raw RGBA pixel buffers inside a Web Worker. All computation runs client-side; no image data leaves your device. Note: processing time scales with pixel count. A 4000×3000 image at radius r = 50 may take several seconds depending on hardware.
Formulas
The Box Blur computes each output pixel as the arithmetic mean of all pixels within a square kernel of side 2r + 1:
For separable implementation (used here), horizontal and vertical passes are applied independently, reducing cost from O(r2) to O(1) per pixel via a running accumulator.
Gaussian approximation via repeated box blur uses box widths computed as:
where σ = blur radius, n = 3 passes. The ideal width is rounded down to the nearest odd integer. Remaining error is distributed by using a slightly larger box on some passes.
Stack Blur maintains a weighted stack of 2r + 1 entries where the center pixel has weight r + 1 and weights decrease linearly to 1 at the edges. The divisor for normalization is:
where r = blur radius, Pout = output pixel value, P(x,y) = input pixel at coordinates (x,y), n = number of box blur passes, D = stack blur divisor.
Reference Data
| Algorithm | Kernel Type | Passes | Per-Pixel Cost | Quality | Best For |
|---|---|---|---|---|---|
| Box Blur | Uniform average | 2 (H + V) | O(1) with accumulator | Low - visible banding | Fast preview, thumbnails |
| Gaussian (3×Box) | Approximated Gaussian | 6 (3×H + 3×V) | O(1) per pass | High - smooth falloff | Photography, UI backgrounds |
| Stack Blur | Weighted stack | 2 (H + V) | O(1) via stack | High - near Gaussian | Real-time effects, large radii |
| True Gaussian | Exact kernel convolution | 2 (H + V) | O(r) | Perfect | Scientific imaging (not implemented here) |
| Comparison assumes separable 2D decomposition | |||||
| Common Blur Radii & Use Cases | |||||
| Radius 1 - 3 | Noise reduction, subtle smoothing for icons and UI elements | ||||
| Radius 4 - 10 | Portrait skin softening, mild depth-of-field simulation | ||||
| Radius 11 - 25 | Background blur for text overlays, privacy masking | ||||
| Radius 26 - 50 | Heavy bokeh effect, frosted glass UI backgrounds | ||||
| Radius 51 - 100 | Color palette extraction, extreme abstraction, ambient light maps | ||||
| Image Format Export Characteristics | |||||
| PNG | Lossless | Largest file size, preserves alpha channel | |||
| JPEG | Lossy (quality adjustable) | Smallest file, no alpha, artifacts at low quality | |||
| WebP | Lossy/Lossless | Modern browsers only, excellent compression | |||