1. An image processing apparatus that processes image data in units of blocks, each block having a predetermined number of pixels, the apparatus comprising: a calculation unit that calculates a number of pixels in the block whose pixel values are different; a specification unit that specifies a predetermined pattern for the block in accordance with the number of pixels whose pixel values are different calculated by the calculation unit and the locations of the different pixels; a compression unit that compresses the image data by outputting the pattern specified by the specification unit and the pixel values of the number of pixels whose pixel values are different; and a determination unit that determines whether the image data is composed of a single color based on the pattern and the pixel values outputted by the compression unit.