1. An image processing apparatus comprising: a correction amount calculation means for calculating a correction amount to compress a dynamic range of an image based on an image data set representing the image; a processing means for obtaining a processed image of which the dynamic range has been compressed by performing image processing on the image, including processing for compressing the dynamic range of the image, by correcting the image data set by the correction amount; and a judgment means for judging whether a change amount of the image by the image processing is larger than a predetermined threshold value, wherein if the judgment is YES, the correction amount calculation means produces an unsharp image of the image and calculates the correction amount by using the unsharp image or if the judgment is NO, the correction amount calculation means calculates the correction amount by using the image.