This module gives a basic image compression example.
We shall represent a monochrome (luminance) image by a matrix
whose elements are
, where
is the integer vector of row and column indexes. The
energy of
is
defined as
where the sum is performed over all
in
.
shows the main blocks in
any image coding system. The decoder is the inverse of theencoder. The three encoder blocks perform the following tasks:
Energy compression - This is usually a
transformation or filtering process which aims toconcentrate a high proportion of the energy of the image
into as few
samples (coefficients) of
as
possible while preservingthe total energy of
in
. This
minimises the numberof non-zero samples of
which
need to be transmitted for a given level of distortion inthe reconstructed image
.
Quantisation - This represents the samples of
to a given
level of accuracy in the integer matrix
. The quantiser step size
controls the tradeoff between distortion and bit rate andmay be adapted to take account of human visual
sensitivities. The inverse quantiser reconstructs
, the best estimate of
from
.
Entropy coding - This encodes the integers in
into a serial
bit stream
, using
variable-length entropy codes which attempt to minimise thetotal number of bits in
,
based on the statistics (PDFs) of various classes of samplesin
.
The energy compression / reconstruction and the entropy coding /
decoding processes are normally all lossless. Only the quantiserintroduces loss and distortion:
is a distorted version of
, and hence
is a distorted version of
. In the absence of quantisation,
if
, then
.