A method is disclosed for controlling the amount of compressed data. One
or more viewing condition parameters are specified, and a quantizer step
size for each frequency subband is determined that minimizes an amount of
data that must be encoded for a compressed representation of the image by
using one or more viewing condition parameters and a model that
characterizes the human visual system. The image is compressed using the
quantizer step size for each frequency subband to produce an amount of
compressed data. The presence of a pre-specified maximum amount of
compression data is determined. The amount of compressed data is compared
to the pre-specified maximum amount. Subsequent discarding of least
visually relevant compressed data reduces the amount of compressed data.