1. An image processing device comprising: a processor; and a memory that stores processor-executable instructions that, when executed by the processor, cause the processor to execute: generating a first intermediate image by applying inverse conversion to an input image, the inverse conversion being inverse of conversion corresponding to degrading process of imaging the input image; generating a second intermediate image by adding a frequency component to the input image, wherein the frequent component is not included in the input image; generating a weighting factor so that a second residual error between a second image and the input image becomes smaller than a first residual error between a first image and the input image, the first image being obtained by applying the conversion to the second intermediate image, and the second image being obtained by applying the conversion to a composite image obtained by the weighted addition of the first intermediate image and the second intermediate image; and generating the composite image by performing the weighted addition of the first intermediate image and the second intermediate image using the weighting factor.