A method for adjusting a target gray level of a target pixel based on a
spatial mask is provided. The target pixel is surrounded with N adjacent
pixels; each of the N adjacent pixels respectively has an adjacent gray
level. The method first multiplies the target gray level with a sharpness
index to generate an amplified target gray level and respectively
multiplies each of the adjacent gray level with an adjacent index to
generate N modified adjacent gray levels. Then, the amplified target gray
level and the N modified adjacent gray levels are added up to generate a
first gray level sum. The method multiplies the first gray level sum with
a multiplying parameter to generate a second gray level sum. At last, the
method divides the second gray level sum by a dividing parameter to
generate an adjusted gray level for the target pixel.