1. A method comprising: comparing a value of a target pixel with a respective value of each of a plurality of pixels located in an area that includes the target pixel; for each pixel of said plurality of pixels that has a value different by at least a threshold amount from the value of the target pixel, replacing the value of said each pixel with the value of the target pixel; and applying a filter function to a set of pixel values, said set of pixel values including the value of the target pixel and current values, after said replacing, of said plurality of pixels.