An image processing method of producing, from a first image, a second image by using sparse coding, the method comprising when an average pixel value in a partial region of an image is referred to as a DC component, and a component acquired by subtracting the DC component from a pixel value distribution in the partial region is referred to as an AC component:
- producing, from the first image, a processing intermediate image having a pixel value distribution in which a difference among multiple pixel values in a partial region of the processing intermediate image is equal to the DC component in a partial region of the first image corresponding to the partial region of the processing intermediate image;
- performing a first process of acquiring, by using the AC component in a first partial region extracted in the processing intermediate image and a basis produced by dictionary learning, the AC component in a second partial region;
- and
- performing a second process of acquiring a difference among multiple pixel values in the second partial region as the DC component in a partial region of the second image corresponding to the second partial region,
- wherein the method repeats the first and second processes with changing a position of extracting the first partial region in the processing intermediate image to acquire the DC components in multiple partial regions of the second image.