1. A method for processing image data comprising: detecting a gray level distribution of frame image data; calculating a cluster size of each of gray levels based on the gray level distribution by determining a locality representing how closely pixels corresponding to each of the gray levels are positioned to each other; determining a remapping function for increasing contrast of the frame image data based on the gray level distribution and the cluster size; and converting the frame image data based on the remapping function, wherein the remappinq function is determined by: 
 G ( g )= G ( g− 1)+ d ( g ), where g is a corresponding gray level of the gray levels, G(g) is the remappinq function for generating a remapped gray level corresponding to the corresponding gray level g, and d(g) is a function that is dependent on the gray level distribution and the cluster size.