1. An image processing apparatus comprising: a color-reduction processing unit which divides image data into blocks each of a 2×2 pixel size, sequentially targets the divided blocks, and performs color-reduction processing for the target block based on color data and attribute data of respective pixels forming the target block; a specifying unit which specifies a pattern flag indicating a layout pattern of color data contained in the target block by comparing the color data of the respective pixels in the target block having undergone the color-reduction processing by said color-reduction processing unit; an extraction unit which extracts, as color data of a first color, color data corresponding to a pixel at a position defined in advance in the block of the 2×2 pixel size having undergone the color-reduction processing by said color-reduction processing unit, and when the number of colors contained in the block having undergone the color-reduction processing is determined to be one of two to four, extracts color data of second to fourth colors corresponding to the layout pattern defined for the specified pattern flag; and an output unit which outputs the pattern flag of the block that has been specified by said specifying unit, the color data of the first color of the block that has been extracted by said extraction unit, and the color data of the second to fourth colors of the block that have been extracted by said extraction unit.