Patent ID: 8244033

Claim:
An image encoding apparatus for encoding image data in which one pixel is expressed by a plurality of bits to have blocks each including m×n pixels as a unit, and generating encoded data having a fixed length of L bits, which are not more than m×n bits, per block, said apparatus comprising: an input unit which inputs image data for respective blocks; an extraction unit which extracts representative colors C 0 and C 1 from image data of an input block of interest; a generating unit which generates identification data of m×n bits by assigning 1 bit indicating one of the representative colors C 0 and C 1 to which each of pixels in the block of interest is approximate, to each pixel; a memory unit which stores pattern data used to, when the number of bits required to specify the representative colors C 0 and C 1 is defined by N, delete {N+1} identification data elements from the identification data for one block generated by said generating unit and to specify deletion target pixel positions which are separated from each other by at least a distance of not less than one pixel; a determination unit which determines, according to the pattern data stored in said memory unit, which of identification data elements approximate to the representative color C 0 and identification data elements approximate to the representative color C 1 are deleted more, and generates determination data of 1 bit indicating the determination result; a correcting unit which corrects non-deletion target identification data which are located near deletion positions, according to the determination result of said determination unit; a deletion unit which deletes the {N+1} identification data elements from m×n identification data elements after correction by said correcting unit, with reference to the pattern data stored in said memory unit; and an output unit which couples data indicating the representative colors C 0 and C 1 extracted by said extraction unit, the determination data generated by said determination unit, and remaining identification data after deletion by said deletion unit, and outputs the coupled data as encoded data of the block of interest.