1. A non-transitory computer-readable storage medium storing an image processing program causing a computer to execute image processing which generates, from a plurality of images formed of a plurality of color components and having a positional displacement, a composite image having a higher resolution than the plurality of images, the image processing program comprising: an obtaining step obtaining the plurality of images and positional displacement information indicating the positional displacement between the plurality of images; a first calculating step calculating, for each of the plurality of color components, a first weighting information and a second weighting information for performing weighting processing on the positional displacement information, the first weighting information being calculated based on a color difference between a predetermined reference pixel value and an actual pixel value, and the second weighting information being calculated based on a difference between a predetermined reference coordinate value and an actual coordinate value; a second calculating step performing, for each of the plurality of color components, the weighting processing based on the first and second weighting information on the positional displacement information and calculating a pixel value of a color component of a calculation target based on (1) local inflection information of a color component among the plurality of color components other than the color component of the calculation target and (2) the positional displacement information after conducting the weighting processing; and a generating step generating the composite image based on a calculation result of the second calculating step.