This invention has as its object to provide an image processing apparatus,
which can obviate the need for image re-input, can effectively generate
encoded data that falls within a set size, and can minimize deterioration
of image quality. To this end, an image processing apparatus according to
this invention includes first discrimination unit for discriminating the
type of image of each of a plurality of regions, which form image data
input, second discrimination unit for discriminating if the image data is
inputted by a continuous scan of images, selection unit for selecting an
encoding method used in compression of each region on the basis of
discrimination results of the first and second discrimination unit, first
compression unit for compressing image data of each region using the
encoding method selected by the selection unit, and second compression
unit for compressing information that pertains to the type of image of
each region.