1. An image processing device comprising: a reflectance-component calculating portion that calculates a reflectance component based both on a pixel value of a subject pixel in an original image and on an average luminance of peripheral pixels around the subject pixel, the reflectance component being indicative of brightness of the subject pixel relative to the peripheral pixels; and a first pixel-value generating portion that generates a pixel value of an output image when the reflectance component indicates that the subject pixel is darker than the peripheral pixels, the first pixel-value generating portion comprising: a first lower-range generating portion that generates the pixel value of the output image based on a first nonlinear function in a first lower range where the pixel value of the subject pixel is lower than a first predetermine value; and a first upper-range generating portion that generates the pixel value of the output image based on a first monotonically increasing function in a first upper range where the pixel value of the subject pixel is greater than or equal to the first predetermine value, the pixel value of the output image increasing toward a first maximum output luminance value as the pixel value of the subject pixel increases, the first maximum output luminance value being greater than a luminance value obtained by correcting a maximum pixel value of the original image based on the first nonlinear function, the first maximum output luminance value being proximate to the maximum pixel value of the original image.