Jpeg Compression

 

   Home  |   Prev  |   Next 

 

Other Loss Less methods

Two Common 1-bit Fax compressions are group 3 and group 4. The group 3 works in one direction along a row of pixels. Group 4 works in both directions and takes into account multiple rows. Although group 4 gives higher compression ratios it has more work to do which results in it being slower than group 3 when compressing or decompressing.

Another method looks for common Patterns in the data and replace them with shorter special codes. For example in text data is to replace common words or parts of words ( the, and, or, in, to, un, ed, for) with a shorter unique code.

Furher ideas involve more processing by counting the number of times a value occurs in the data. The most frequent values are assigned short codes which get longer and longer as the frequency of the value reduces. A perfect example of this is Morse Code - remember that thing with dots and dashes on the radio. The letter E (the most common character in English) is a single dot and less common characters like J & Q may have 4 or more dots and dashes. The overall effect is to shorten the coding on a typical message.

In cases such as English text the typical frequency of characters is well know and a standard coding table or dictionary can be used instead of calculating a new table from scratch each time. In essence we are calculating or predicting the probability of values in the raw data. Huffman coding is based on this idea.

What is important is to match the compression method to the type of information in the data. Choosing the wrong method will either make the file bigger or give poor compression. Advanced compression programs first analysis the data to decide which is the best method to use.

The LZW Compression is very effective and uses the more complex ideas but unfortunately it's use required a license and is only found in expensive versions of photo editing software.

Image pixel data is stored in one of two formats. Contone (CONtinuous TONE) where data is stored in bytes to represent the different levels of brightness and colour. This is the type of data produced by a scanner or camera. For the purposes of printing newspapers and magazines on a printing press these are converted and stored in 1-bit image format. Basically a stream of zeros and ones ( on - off signals if you like). Often referred to as 1-bit tiff or bitmaps, Line Art and half tones images. The Loss-less Group 3 and 4 compress 1-bit data very well. It is the Contone data that presents the headache for loss-less compression.