1. An image processing method that separates an input image into a skeleton component including an edge component and a flat component and into a residual component expressed by a difference between the input image and the skeleton component, the method comprising: calculating a local variation amount that is a variation amount between a target pixel and a pixel adjacent to the target pixel; calculating a filter weight for extracting the skeleton component based on the local variation amount; calculating an image feature amount of a gradient direction of a pixel value in a surrounding of the target pixel and an image feature amount of a gradient strength of the pixel value in the surrounding of the target pixel; correcting the filter weight based on the image feature amount in the gradient direction and the image feature amount of the gradient strength; calculating a filter coefficient based on the corrected filter weight; and extracting the skeleton component by applying skeleton component extraction filtering to the target pixel using the filter coefficient.