A method and device for reducing a compressed image to a target size by reducing
the quality of the image by a quality scaling factor. Image statistics inherent
to the image are used to compute the size reduction as a function of the quality
scaling factor. Using the relationship between the quality and the size of the
image, an estimated quality scaling factor is obtained based on the target size
in an iterative process until the size reduction corresponding to the estimated
quality scaling factor is substantially equal to the target reduction.