1. A method of filtering an image, comprising: reading out pixel values for pixels in a plurality of pixel blocks of the image; determining block average pixel values for each of the plurality of pixel blocks; for a first pixel with a first pixel value read out after reading out of the pixel values from the plurality of pixel blocks, identifying if the first pixel value differs from the block average pixel values by less than a threshold value for each of the plurality of pixel blocks, thereby indicating whether the first pixel is in a flat region; and if the first pixel is in a flat region, using the block average pixel values to smooth a value of the first pixel.