Patent ID: 7466863

Claim:
An image encoding apparatus which receives image data, and encodes and outputs the image data and area information, comprising: input mode setting means for setting whether input image data is a character line image or a halftone image; image encoding means for encoding image data in accordance with a first parameter for determining a compression ratio; re encoding means for decoding encoded data generated by said image encoding means, and re encoding the decoded data in accordance with a second parameter for determining a compression ratio; attribute detection means for detecting area attribute information of input image data; attribute correction means for correcting the area attribute information in accordance with a third parameter; attribute encoding means for encoding the area attribute information corrected by said attribute correction means; initial parameter setting means for determining the first parameter and the third parameter in accordance with an input mode set by said input mode setting means, and respectively setting the first parameter and the third parameter for said image encoding means and said correction means; monitoring means for monitoring a total code amount as a sum of an image encoded data amount generated by said image encoding means and an attribute encoded data amount generated by said attribute encoding means in accordance with the set parameters during input of a 1 page image, and determining whether the total code amount is not less than a predetermined value; parameter update means for, when said monitoring means determines that the total code amount is not less than the predetermined value, (a) updating the first parameter set for said image encoding means to a new first parameter of a higher compression ratio, and causing said image encoding means to continue encoding of image data, and (b) setting a second parameter equal to the updated new first parameter for said re encoding means, and causing said re encoding means to re encode image encoded data before the total code amount is not less than the predetermined value; and control means for, when said parameter update means updates the parameters, (a) causing said re encoding means to re encode, in accordance with the second parameter, encoded data generated by said image encoding means before the new first parameter is set, and storing the re encoded data as encoded data generated by said image encoding means after the new first parameter is set, and (b) storing the encoded data generated by said image encoding means after the new first parameter is set as succeeding encoded data.