An original image is subjected to an opening processing and to a closing processing
to obtain a blurred image by using an average value between the result of the opening
processing and the result of the closing processing as a reference for correcting
the brightness. The brightness of the original image is corrected by multiplying
a difference between the blurred image and the original image, by a ratio of an
upper limit value of brightness to a difference between the upper limit value of
brightness and the blurred image. Then, the brightness of the original image is
corrected based on the blurred image which enhances the contrast of a highly bright
portion of a predetermined area or more while lowering the brightness of that portion.
Contrast and brightness of the whole image can be adapted to the sensitivity of
human eyes.