Patent ID: 7835582

Claim:
An image encoding apparatus comprising: a determination unit which determines for respective tiles whether image data of a page of interest is to be lossless-encoded or lossy-encoded; a lossless encoding unit which lossless-encodes tile image data which is determined by said determination unit to be lossless-encoded; a storage unit which temporarily stores tile image data determined by said determination unit to be lossy-encoded; a resolution converting unit which reduces a number of pixels of non-compressed tile image data held in said storage unit so that a data size of the non-compressed tile image data held in said storage unit becomes not more than a predetermined size, during lossless encoding of the image data of the page of interest; and a lossy encoding unit which lossy-encodes the non-compressed tile image data of the page of interest held in said storage unit after completion of the lossless encoding of the image data of the page of interest, wherein said lossless encoding unit includes: a buffer memory which temporarily stores non-compressed tile image data; a second resolution converting unit which reduces a number of pixels of the tile image data stored in said buffer memory in accordance with input setting information; a selection unit which, when said determination unit determines that tile image data of interest is to be lossless-encoded, selects lossless-encoded data generated from the tile image data of interest, for, when said determination unit determines that the tile image data of interest is to be lossy-encoded, selecting the tile image data before compression stored in said buffer memory, and for outputting the selected data to said storage unit; a counting unit which counts a number of times of selection of the tile image data stored in said buffer memory by said selection unit; and an updating unit which updates the setting information to be set in said second resolution converting unit every time the number of times counted by said counting unit exceeds one of a plurality of thresholds determined according to the predetermined size.