So far we have taken a linear combination of pixels in the box around the input pixel, but non-linear operations like sorting and ranking the pixel values also prove to be very useful. We look at the median filter which is much better at removing salt and pepper noise from image than simple smoothing.