It aims to prevent occurrence of gradation jump or color displacement even
if a process for improving a brightness distribution of a digital image
to be processed is performed. An image processing method for achieving
such prevention comprises: an extraction step of extracting a brightness
component from image data; a scale conversion step of obtaining a
distribution of the brightness component on relatively large scale; an
improvement step of improving the brightness component distribution of
the image data by using the brightness component and an output in the
scale conversion step; and a gradation compression step of judging
whether or not the image data reconstituted according to the improved
brightness component distribution is within a predetermined color gamut,
and, when it is judged that the reconstituted image data includes the
image data outside the predetermined color gamut, of performing a
gradation compression process.