1. A method of processing pixels of an image comprising: segmenting the image into smaller segments according to a predetermined algorithm; determining a variance of pixels in the respective segments; determining a homogeneity value from the variance of the pixels in the respective segments; determining a most homogenous region of the pixel image from the homogeneity value; calculating a first normalized accumulated histogram of the edge transitions within the most homogenous region; calculating a threshold value based on the first histogram; calculating a second normalized accumulated histogram of the edge transitions that are above the threshold value; calculating a gain of the image peaking from the second histogram; using the threshold value to select those pixels to which image peaking is to be applied; and applying the gain to the selected image pixels.