Skip to content
Learnearn.uk » A Level Computer Science Home » Data Compression

Data Compression

Images

Image Compression

Why do we need image compression?

Let’s take the image above. This image is a relatively small 2 Megapixel image, with dimensions of 2133 x 974 pixels.

This image is a 24 bit RGB image, meaning that it’s file size should be:

2133 x 974 x 24 = 49.8 Megabits

Divide by 8 to get Megabytes = 6.2 Megabytes

This massive file would take about 15 seconds to send to a friend, if you had an excellent phone connection speed – if you were to take and send a full size uncompressed 20 Megapixel photo (that modern smartphones take) it would take at least a minute!

The file above has been compressed slightly using a lossy compression algorithm and is only 500 KB (12x smaller!)

How does it work?

Slight changes in color are not perceived well by the human eye, while slight changes in intensity (light and dark) are. Therefore JPEG’s lossy encoding tends to be more frugal with the gray-scale part of an image and to be more frivolous with the color.

JPG Compression Article

Audio

Video

Lossless Compression

Lossy Compression

Encoding

Resources