A quality level determining the extent to which each image file is
compressed is automatically computed for each image file in a set to
ensure that the total size of the compressed image files does not exceed
a predefined limit. The compressed size of each image file is initially
determined when compressed at a predefined minimum acceptable level and
at a nominal level. The relative complexity of the image files is
determined based upon their high frequency energy content. As a function
of the image file complexity, and starting with the compressed sizes
initially determined, the appropriate quality level is determined for
compressing each of the image files in an iterative process that ensures
the total size of the compressed image files does not exceed the
predefined limit, while retaining acceptable quality. Thus, a set of
image files can be compressed optimally to fit within a limited storage.