Surface Blur

A plugin designed for blurring with edge preservation, written by Douglas Cameron.

The technique is similar to several others that have previously been implemented e.g. Selective Gaussian Blur and the Bilateral Filter.

A new value for each pixel is calculated as a weighted average of a subset of the surrounding pixels within a set radius. Two factors are considered with regards to surrounding pixels, RGB difference and the distance from the central pixel. The subset of pixels used is comprised of pixels whose RGB difference is found to be below a set threshold. The weighting assigned to the these pixels is dependent upon the distance from the central pixel.

The following diagram shows a pixel and surrounding pixels within a radius of 2. The pixels surrounded by a pink border are excluded from the calculation due to their RGB difference being above the set threshold.

pixel_sample

Variable parameters include:

  • Radius: The radius of surrounding pixels considered.
  • Proximity Weighting: The weighting given to the surrounding pixel relative to the distance.
  • Edge Threshold: The threshold which is used to discriminate between pixels on the near and far side of an edge
  • Iterations: The number of times the blur shall be performed

Below is an example, before and after the application of the surface blur.

Surfaceblur Example Before

Surfaceblur Example After

The calculations involved are relatively simple and can be easily found in the source code.

FilenameFilesizeLast modified
surface_blur.class33182010/01/26 11:21
surface_blur.java28092010/01/26 11:21
surfaceblur_example_after.jpeg1218612010/01/26 11:21
surfaceblur_example_before.jpeg1274582010/01/26 11:21

Douglas Cameron 2007/08/17 15:32

plugin/filter/surface_blur/start.txt · Last modified: 2010/01/26 11:18 (external edit)
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0