Jpeg Compression

 

   Home  |   Next 

 

Introduction

I have written this article to provide an insight into the world of data compression. It's objective is to provide those interested in photography a basic understanding of how image data is compressed. Some of you may of come across debates on the benefits of Raw format over the Jpeg format. Many of the points raised about the Jpeg format are basically true but based on guesswork due to the lack of detailed knowledge on it's internal workings. I intend to examine and explain the Baseline Jpeg compression methods strengths and weakness.

Let me first explain how and why data can be compressed. In order to understand this there are some concepts you need to grasp.

  • Think of a computer file as a container, cardboard box or an envelope. It can hold something of a certain size.
  • Think of a computer image as an egg tray or a piece of graph paper. It has a set number of pixel positions dependant on its width and depth. Therefore an image is held in a fixed size of computer display memory.
  • Think about the amount of Information an object contains. This last concept is more abstract and not so easy to grasp.

To illustrate the last point consider a sheet of A4 size paper with some printed text.

First example it just has the greeting "Hello World"

 

Second example is an Electricity Bill

Compared to "Hello World" the Electricity Bill contains more information such as Address, telephone number, price, usage, date, etc. Therefore the first example will fit onto a smaller sheet of paper and a larger sheet is required for the Electricity bill.It then follows that a smaller envelope or container can be used to hold the first example.

The Key point being there is a lot of wasted ( redundant - unused ) space on the "Hello World" example. Data Compression is about finding a more efficient code to hold the information. If the information is already stored efficiently with no waste then it will not be easy to compress it further.