Conservative filter

This very mild non-linear smoothing filter simply ensures that the value of the output pixel is within the bounds of its neighbours. The maximum and minimum values of the pixels adjacent to the input pixel are calculated. If the input pixel is within this range, it is not changed. If it is greater than its largest neighbour, then the output pixel is set to that maximum value. Similarly, if it is less than its smallest neighbour, then the output is set to that minimum value.

Since it does not involve any averaging, conservative smoothing does preserve edges and other high-frequency information… like noise. Conservative smoothing deals well with images containing a small amount of spiky noise, affecting perhaps 1 pixel in 100. Unfortunately, if there are two spikes in the support then neither is removed. This filter does not attenuate random noise at all.