Contrast in an image is enhanced by mapping an input intensity value to an
output intensity value in accordance with a mapping function. A mean
intensity value of the image is determined. Co-ordinates of the mapping
function are calculated in accordance with the mean intensity value and a
plurality of predefined parameters. The mapping function is applied to
the input intensity value for determining the output intensity, wherein
the mapping function is generated dynamically for each image.