A176805 Sistem Multimedia

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

KT4113 Multimedia Systems

Assignment 2 – Image Compression

Name: Nur Aisyah binti Kebehi


Matric. No: A176805

A. BMP File
1. The BMP file chosen for this assignment is shown below:

Total file size 790,528 bytes


Image size 786,486 bytes
Header size 4042 bytes

B. GIF File
3. The original image, dithered image and MSE image is as shown in Fig. 1 below:

Original Image Dithered Image MSE Image

Comment: Dithered image color is reducing compared to original color and lowering the quality
of the picture.

The RMSE Value: 3.144438

C. JPEG files
4. The Y, Cb and Cr components of the image are as shown below:

Y component Cb component Cr component

Comment: Y`Cb`Cr colour space is that it can separate luminance from chrominance more
effectively compare to RGB colour space. Luminance in the image is actually a light intensity or
the amount of light ranges from black to white.

5. The original image, JPEG image and MSE image is as shown in Fig. 3 below:

Original Image JPEG image MSE image

Comments: the RMSE value of the jpeg increase therefore the image had a huge reduction in file
size but the quality of the picture is maintained.
The RMSE Value: 4.609241

Comparison between BMP, GIF and JPEG files

File Type Overall File Size RMSE


BMP 786,486 bytes 0.000000
GIF 148,258 bytes 3.144438
JPEG 27,383 bytes 4.609241

Comment:

BMP is the highest file size than GIF and JPEG, therefore BMP images a higher resolution than JPEG
and GIF. GIF has the lower value than JPEG as it is better the model and its predictions. JPEG uses
lossy compression algorithm where the image may lose some of its data, whereas GIF uses lossless
compression algorithm where there is no or less data loss.

D: JPEG compression in more detail

1. Rationale for the main steps in JPEG compression:

Blockwise DCT: converts the information contained in a block (8x8) of pixels from spatial domain to
the frequency domain.

Quantization: Quantization using a table or using a constant to reduce number of bits per sample

DPCM: Encode the difference between the current and previous 8x8 block, the smaller the number
the fewer the bits.

Zig-Zag scanning: Zig-Zag scan to exploit redundancy and to group low frequency coefficients in top
of vector and high frequency coefficients at the bottom

Run Length Coding: The 1 x 64 vectors, to make it most likely to hit a long run of zeros, have a lot of
Zeros in them; it is more towards the end of the vector. Higher up entries in the vector capture
higher frequency (DCT) components which tend to be capturing less of the content. Encode a series
of 0s as a (skip, value) pair, where skip is the number of zeros and value is the next non-zero
component.

Entropy Coding: The DC and AC coefficients finally undergo an entropy coding step to gain a possible
further compression. DC components are differentially coded as (Size , Value). Entropy code
(Huffman) of the final output.

2. Difference between encoding of Y and Cb/Cr components:

The blockwise DCT of the Y, Cb and Cr components of the image are as shown below:

Y component Cb Component Cr Component


Compression of each component:

Comment Compression rate (bits/pixel) Compression ratio


Y 0.71857 bits/pixel 11.1333
Cb 0.26279 bits/pixel 30.4429
Cr 0.23041 bits/pixel 34.7211
Overall component 0.40392 bits/pixel 19.8059

Comment: Y separate out the luma signal so that it can be stored with high resolution or
transmitted, Cb and Cr can be compressed with maintaine quality.

The original image, decoded image and MSE image is as shown in Fig. 3 below:

Original Image Decoded Image MSE image

Comments:

The RMSE Value: 6.428636 

Comments on comparison with JPEG compression within imwrite:

To be compared, the JPEG compression support the quality parameter of the image even through it
hugely reduced the file size. The MSE value of jpeg compression is lower than the decoded image,
therefore the quality of the decoded is not as better as the jpeg picture.

You might also like