A non-transitory computer-readable storage medium storing a program for causing a computer to execute an image processing method which is executed by an image processing apparatus, comprising:
- a histogram detecting step of detecting a luminance histogram from an input image;
- a determination step of determining control points for use in generation of a tone curve from based on such a luminance that a percentage from a low-luminance side in the luminance histogram detected in the histogram detecting step is equal to a first value, and such a luminance that a percentage from a high-luminance side in the luminance histogram detected in the histogram detecting step is equal to a second value;
- a tone curve generating step of generating a tone curve based on the control points determined in the determination step;
- an image processing step of performing image processing based on the tone curve generated in the tone curve generating step;
- and
- a judgment step of judging whether illuminance of a shooting environment is low,
- wherein in the determination step, when it is judged in the judgment step that illuminance of the shooting environment is low in determining the control points for use in generation of the tone curve, the second value is made greater than in a case where when it is not judged in the judgment step that illuminance of the shooting environment is low.