Patent ID: 8606003

Claim:
An image processing device, comprising: a unit configured to divide input image data into blocks each containing M×N pixels (M and N are each an integer of 1 or more, and at least one of M and N is an integer of 2 or more); a first compression unit configured to obtain first compression result data by assigning one of two colors to each of the M×N pixels included in each block, the first compression result data including data indicating the two colors and a pattern indicating the arrangement of the two colors; a second compression unit configured to, in each of the blocks, discard predetermined low-order bits of each of color components included in the block in order to compress the image data and obtain second compression result data; a first calculation unit configured to, in each of the blocks, determine a difference between each sum of R, G, and B data in the input image data and each sum of R, G, and B data in decompressed image data of the image data compressed by the first compression unit for each data of R, G, and B, and to determine an absolute value sum of the difference determined for each data of R, G, and B data in order to calculate first difference data; a second calculation unit configured to, in each of the blocks, determine a difference between each sum of R, G, and B data in the input image data and each sum of R, G, and B data in decompressed image data of the image data compressed by the second compression unit for each data of R, G, and B, and to determine an absolute value sum of the difference determined for each data of R, G, and B, in order to calculate second difference data; a comparison unit configured to compare the calculated first difference data and second difference data in order to determine the smaller difference from the difference in a gradation value between the first compression result data and the input image data and the difference in a gradation value between the second compression result data and the input image data; and an output unit configured to output, as a compression processing result of the corresponding block, either the first compression result data or the second compression result data which is determined to have smaller difference in the gradation value based on a result by the comparison unit, wherein in a case where the block of M×N pixels is represented by one color, the first compression unit assigns the same color to the data indicating two colors such that the amount of the first compression result data has the same value for each block, and the size of the first compression result data obtained by the first compression unit and the size of the second compression result data obtained by the second compression unit are the same.