Compression algorithms

Prepress files are often huge so it is no more than logical that data are compressed. There are quite a few compression algorithms that can be used for both text and images. A basic knowledge about how the different algorithms work can be worthwhile.

These pages give an overview of the various compression algorithms that are used in the prepress industry. It is by no means a complete overview of all available algorithms. The following types of compression are documented in more detail:

I have not yet documented:

  • CCITT group 3 & 4
  • JBIG

Types of compression algorithms

The above algorithms can be divided into two distinct categories: they are either lossless or lossy.

  • Lossless algorithms do not change the content of a file. If you compress a file and then decompress it, it has not changed. The following algorithms are lossless:
    • CCITT group 3 & 4 compression
    • Flate/deflate compression
    • Huffman compression
    • LZW compression
    • RLE compression
  • Lossy algorithms achieve better compression ratios by selectively getting rid of some of the information in the file. Such algorithms can be used for images or sound files but not for text or program data. The following algorithms are lossy:
    • JPEG compression

Which algorithm is best?

Unfortunately there is no fixed answer to that question. It all depends on the type of file that has to be compressed as well as the actual content of the file and the question whether you are willing to accept a lossy algorithm for that particular file. As a general rule, here is what most people in prepress use or find appropriate:

  • text: often not worth compressing, sometimes RLE is used
  • line-art images : LZW
  • line-art and screened data: CCITT group 4
  • grayscale images: LZW for files that do not contain too much detail
  • color images : JPEG if lossy compression is acceptable
  • vector drawings: not supported by applications

17 thoughts on “Compression algorithms

  1. I just wanted to know the detailed version of image compression technologies before jpeg2000 especially with the comparisons and reasons for launching jpeg200

  2. Hi,

    Is it possible to further compress an already compressed data? Say we used LZ compression on our data then this data will pass on a WAN optimization device that “compress” data so that it can pass on a small bandwidth link. Will this further reduce the LZ compression output? or just pass it because it is already compressed? Thanks, appreciate any helpful reply.

  3. I want to know the best algorithm for compressing text in c++ langauge if any one get please attach link also .

  4. I still do thesis about this topic in data compression with Huffman, what is the best for it?

  5. Hi, i am a computer science student. My group proposed a topic for our thesis about comparison of the best algorithm in file compression. Can you help me to give a bit background of it? Thanks 🙂

  6. is it possible to compress a single file.. for example a video file. could it be compressed to half of its size? thank you. #THESISit! 🙂

  7. I’m developing a software to compress various types of files like audio,video,images etc.
    i want to know which would be the best algorithm.
    i want to compress the files to the unreadable format and decompress them to readable format as required.

    1. There is no universal compression algorithm that can be used for all the data types you list. Audio compression is different from video compression which is different from image compression. This site focusses on print – and as such contains advice about various algorithms for images. Even for these there is no single algorithm that works best for all types of images. Depending on the type of image (black & white, grayscale, RGB, CMYK) a different algorithm is better. There is no easy answer because you do not provide much information. If, for instance, it is unacceptable for your customers to lose details in images, JPEG compression is out of the question.

  8. Is it possible to compress a text using huffman compression technique ? please let me know asap.

  9. Hi Ali,

    Is DMS package complete?? Please let me know the details. I am intersted in it.

    Regards
    Furqan Naqvi

  10. Dear sir,
    We are devolping a DMS Package ( Document Management System ) , and we very interested on the following:

    1- Documents Compression
    2- Documents Encryption

    Best Regards
    Ali Malkawi

Comments are closed.