method of the present invention; FIGS. 12A and 12B each is a diagram for showing a division pattern example at the time of dividing an input image IN into range blocks, and FIG. 12C is a diagram for illustrating how to determine the weights of the respective range blocks; FIG. 13 is a block diagram showing the configuration of the image processing apparatus (in First Variation of Second Embodiment