1. A method of processing pixels of an image comprising: determining the most homogenous region of the image; calculating a threshold according to the content of the determined region; selecting pixels in the image according to the calculated threshold; and applying a gain to the selected pixels.