An image obtained by being imaged by an imaging device and converted to
color data using a color processing parameter is input and target color
data corresponding to converted color data is input. Next, the color
processing parameter is optimized based upon the color difference between
the converted color data and target color data. When the optimization
processing is executed, first optimization processing is executed for
optimizing the color processing parameter using the first target color
data being within a prescribed color gamut, and the converted color data
corresponding to the target color data, and second optimization
processing is executed for optimizing the color processing parameter
using second target color data, which includes the target color data
being out of the prescribed color gamut and is less than a prescribed
threshold value, and the converted color data corresponding to the second
target color data.