A non-transitory computer readable storage medium storing a computer program for causing a computer, which stores a plurality of first feature quantities that can express a feature quantity in any image with a linear sum thereof and stores a plurality of second feature quantities indicating a feature quantity of a high image quality corresponding to the first feature quantities, to execute steps of:
- calculating, from a feature quantity of an image targeted for image quality enhancement, a coefficient for expressing the feature quantity with the linear sum of the plurality of first feature quantities;
- and
- generating an image that is the image with the image quality enhanced by replacing each of the first feature quantities included in the linear sum which has used the calculated coefficient with corresponding second feature quantities, wherein the step of calculating a coefficient has steps of:
- determining, based on a correspondence relationship between a feature quantity of any image and the number of first feature quantities necessary for expressing the feature quantity with a linear sum of fewer first feature quantities than the total number of the plurality of first feature quantities, the number of first feature quantities used for calculation among the plurality of first feature quantities;
- selecting the number of first feature quantities which has been determined, from among the plurality of first feature quantities;
- and
- calculating the coefficient based on the selected first feature quantities and the feature quantity.