Patent ID: 8452112

Claim:
An image encoding apparatus for inputting image data encoded for each pixel block formed from a plurality of pixels and re-encoding the image data, comprising: an intermediate data storage unit which stores the encoded image data of re-encoding target as intermediate data; a decoding unit which decodes each block of the intermediate data stored in said intermediate data storage unit and stores the decoded image data in a buffer; a discrimination unit which discriminates a foreground image area including a character or line art by analyzing the image data stored in the buffer; an identification unit which identifies each pixel of image data inside the foreground image area discriminated by said discrimination unit as a character or line art pixel included in the character or line art or a non-character or line art pixel and generates identification information; a first encoding unit which encodes the identification information obtained by said identification unit and outputs the encoded identification information; a replacement unit which replaces a value of the character or line art pixel inside the foreground image area of the image data stored in the buffer with a replacement value decided based on values of neighboring non-character or line art pixels; a second encoding unit which generates encoded data of a pixel block based on the image data after replacement by said replacement unit; an encoded data acquisition unit which acquires, from said intermediate data storage unit, encoded data of a pixel block; and a selector that selects the encoded data from said second encoding unit if a pixel block of interest is inside the foreground image area, while selects the encoded data stored in said encoded data acquisition unit if the pixel block of interest is not inside the foreground image area.