Transform Coding
The JPEG image compression standard is a transform coding technique which uses a blockbased DCT. This experiment will apply the same coding technique (quantization of transform coefficients) to a facimile test image using the DGT and a blockbased DCT. The DCT is implemented with 8x8 blocks to match the 8 pixel centers of the DGT basis functions. The Joint Photographic Experts Group (JPEG) is the working group of ISO, International Standard Organization, that defined the popular JPEG Imaging Standard for compression used in still image applications. The counter part in moving picture is the ``Moving Picture Experts Group" (MPEG).
JPEG compression is based on certain transform, either DCT or wavelet transform, due to the essential properties of orthogonal transforms in general:
 Decorrelation of the signal;
 Concentration of its energy.
Here are the steps of JPEG image compression based on DCT:

Divide the image to form a set of blocks and carry out 2D DCT transform of each block. The computational complexity for 2D DCT of an image is , while the complexity of 2D DCT of all by blocks of image is
The larger the image size , the more saving by subblock transform. As adjacent pixels are highly correlated, most of energy in an 8 by 8 block is concentrated in the low frequency region of the spectrum (upperleft corner) and the rest transform coefficients are very close to zero. 
Threshold all DCT coefficients smaller than a value T to zero, or alternatively, lowpass (either ideal or smooth) filter the 2D DCT spectrum of each subimage;

Quantize remaining coefficients: Divide (elementwise) each block by a quantization matrix Q:
and round resulting 8 by 8 elements to nearest integer ( represents rounding to the closest integer). At the receiving end:

Larger causes larger error. Let , and K be an integer as the rounding result of a pixel , then the possible value for the pixel is in the range:

Larger causes larger error. Let , and K be an integer as the rounding result of a pixel , then the possible value for the pixel is in the range: