1. An image processing apparatus, comprising processing circuitry configured to: repeatedly decompose a first image in which pixels thereof are arrayed in two-dimensional or three dimensional directions into high-frequency components and low-frequency components until the number of pixels becomes a predetermined number in each of the directions, and generate a second image based on the low-frequency components in a result of the last decomposition; uniformize the brightness of an entire area of the second image; and restore an image having the same number of pixels as that of the first image in each of the directions using the brightness uniformized second image, wherein the processing circuitry is further configured to generate a third image in which the same number of pixel values as that of the first image are arrayed in each of the directions based on the brightness uniformized second image, and the third image is used when the restored image is generated.