Patent ID: 8849021

Claim:
A compression method comprising: an input step of inputting image data; a division step of dividing the image data inputted by the input unit into blocks, wherein each of the blocks has M×N pixels (where M and N are integers greater than or equal to 2); a color reduction step of performing first color reduction on each of the blocks to generate (M×N−1) reduced-color blocks with reduced-color block K, where 1≦K<(M×N−1), having K different colors in a case where the each of the blocks has M×N colors; an acquisition step of acquiring differences between pixel values for each of the reduced-color blocks generated from said each of the blocks and pixel values for said each of the blocks before the first color reduction, wherein the differences are acquired for each and every one of the (M×N−1) reduced-color blocks; a generation step of generating a first table in which a plurality of thresholds are associated with either amount of data to be reduced in the image data or amount of data to be remained in the image data, based on the differences acquired by the acquisition unit for each of the blocks in the image data, wherein the plurality of thresholds are indexes for indicating pixel values of one block for compression; a specifying step of specifying a threshold at which an amount of data after compression of the image data is equal to or less than a target data amount, based on the first table; and a compression step of performing second color reduction of the number of colors of each of the blocks based on the threshold specified in the specifying step, and generating compressed data by the second color reduction.