1. An image processing device comprising: a block histogram generation portion that calculates a frequency of a pixel value for each of blocks formed of a plurality of pixels, divides a dynamic range into N ranges (where N is an integer larger than one), generates a first histogram formed by N bins in which a width of one bin corresponds to a plurality of pixel values, extracts the first histogram of a high luminance block formed by pixels having a high luminance value from among the plurality of blocks of an entire image, mixes the first histogram of each of the blocks and the first histogram of the high luminance block, and generates a second histogram for each of the blocks; a pixel histogram generation portion that, based on the second histogram of a block including a target pixel and the second histogram of a block adjacent to the block including the target pixel, calculates a frequency of a pixel value that depends on a pixel position in the block of the target pixel, and generates a third histogram formed by N bins for each pixel; and an output value determination portion that generates a relationship between the pixel value and an output value of the pixel value based on the third histogram such that a maximum cumulative frequency of the third histogram matches a maximum value of the output value of the pixel value, and calculates the output value from the pixel value of the target pixel.