Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Are you a Java Developer working with Image files?

Read and write images in Java with JDeli

What is CCITT compression?

1 min read

CCITT is a lossless compression format used to compress 2 color images (usually black and white). It is used for TIFF compression.

What does CCITT stand for?

The initials CCITT comes from Comité Consultatif International Téléphonique et Télégraphique which was created in 1956. This international group (which is part of the even older International Telecommunication Union) defined the standards.

How does CCITT compress data?

There are actually several different versions of CCITT compression, generally known as Group 3 and Group 4. Group 3 encodes each line individually whereas Group 4 references the previous lines.

CCITT Uses a technique called Huffman encoding, which allows the data to be squeezed into a much smaller compressed stream. It creates a dictionary of variable length keys, assigning the shortest keys to the most common data patterns. It works best on images which contain long repeating pixels of a single colour. We have a more detailed post on How does CCITT compress image data?

How do I use CCITT?

A big initial use for CCITT was reducing the size of images send by fax machines (do you know anyone who still uses a fax machine?). These days, it is used in Tiff images and PDF Documents to reduce file size without any loss of image quality.

CCITT is generally used as part of something else (fax machine, TIFF reader, PDF library) so there is generally not much ‘standalone’ CCITT software. But there is good support for in most TIFF and PDF libraries. If you do have raw CCITT data, you can convert it into a TIFF image file by adding some additional data to it.

If you do need the option to compress or decompress CCITT, this is a feature in our JDeli Image library.



Find out how to read and write images files in Java with JDeli:

Read: BufferedImage image = JDeli.read(streamOrFile);

Write: JDeli.write(myBufferedImage, OutputFormat.HEIC, outputStreamOrFile)

Learn more >>

Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.