Patent ID: 8041135

Claim:
The image encoding apparatus, that encodes image data in which character and/or line image data and halftone image data are mixed, comprising: an input unit that inputs image data as an encoding object in block units consisting of a plurality of pixels; an acquisition unit that acquires pixel data of a character and/or line image and identification information for identifying whether pixel data is pixel data of a character and/or line image or pixel data of a halftone attribute from image data of a block that is input; a first encoding unit comprising a processor that encodes the character and/or line image data that is acquired by said acquisition unit; a second encoding unit that encodes the identification information that is acquired by said acquisition unit; a substitution unit that substitutes pixel data that is acquired as a character and/or line image in image data of the block that is input with a substitution value that is determined based on pixel data having a halftone attribute; a third encoding unit that subjects image data in a block unit after substitution by said substitution unit to frequency conversion, and encodes resulting data; and a code stream generation unit that synthesizes encoded data that is generated by said first to third encoding units to generate encoded data in a block unit, wherein said substitution unit determines as the substitution value a value that is approximate to a direct-current component value after the frequency conversion in a case in which said substitution unit assumes the block that is input possesses only pixels with a halftone attribute, wherein said first and second encoding units are lossless encoding units and said third encoding unit is a lossy JPEG encoding unit, and wherein when a number of pixels having a character and/or line image attribute in one block is taken as N, and a sum total and an average of pixel data having a halftone attribute are taken as D and D ave , respectively, a direct current component DC that said substitution unit calculates at a time of a DCT transformation operation is determined by the following formula: DC =( D+D ave ×N− 128×64)/8, and, when a value D p that is an integral multiple of a quantization step Q used when quantizing a direct current component at said third encoding unit and that is approximate to the direct current component DC that is calculated is defined, the substitution value Z is determined according to the following formula: character and/or line Z =(8 ×D p −D+ 128×64)/ N.