In this course project we were to design a JPEG (Joint Photographic Experts Group) encoding and decoding scheme for a raw RGB-image. The corresponding pipeline for doing the same has been shown in the picture above.
We all know that JPEG (.jpg) file format is lossy. The loss stems from two steps, in the encoding pipeline:
The DCT (Discrete Cosine) transform is the first source of the loss because we only choose a finite number of coefficients for representation, being constrained by the memory of the computer.
The Quantisation step is the other source, wherein we loose information the moment we represent the coefficients obtained from the DCT in quantized levels.
The figure below shows a sample result of our system. The image on the left is the original raw RGB image. The one on the right is the image obtained after encoding and decoding with a high level of quantization. The output image is rendered in blocks of 8x8 pixels. The block-by-block rendering contributes to the row like appearance which the image takes and the high quantization results in the quality drop.