1. An image processor performing a process of specifying an area to which a plurality of pixels of a grayscale image belongs, the grayscale image being formed based on a pixel values of each of the plurality of pixels arranged on a predetermined coordinate system, the image processor comprising: a gradient information calculating unit that calculates gradient information corresponding to a change in the pixel values between the plurality of pixels; an extreme value coordinate acquiring unit that sets a pixel selected from the plurality of pixels as a target pixel, performs a scanning on at least one of the plurality of pixels including the target pixel from the target pixel in accordance with the gradient information, and acquires a coordinate of the scanned pixel corresponding to an extreme value of the pixel value as a coordinate of an extreme value pixel corresponding to the target pixel; and an area specifying unit that labels the target pixel with an area identification mark used for specifying the area to which the plurality of pixels belongs, wherein the extreme value coordinate acquiring unit successively sets the each of the plurality of pixels as the target pixel and acquires the coordinate of the extreme value pixel corresponding to the each of the plurality of pixels, and wherein if coordinates of extreme value pixels corresponding to different pixels in the plurality of pixels are located close to each other within a particular range, the area specifying unit labels each of the different pixels with an area identification mark indicating the identity of the area to which the plurality of pixels belongs.