Group 4 compression
Group 4 compression, formally known as ITU-T Recommendation T.6, is a lossless algorithm designed for compressing bi-level (black-and-white) raster images, employing two-dimensional Modified Modified READ (MMR) encoding to achieve typical compression ratios of around 15:1 while ensuring no data loss or degradation in image quality.[1] This method was developed specifically for Group 4 facsimile apparatus, enabling efficient transmission and storage of scanned documents and line art.[2]
Standardized in 1988 by the International Telecommunication Union (ITU), formerly the International Telegraph and Telephone Consultative Committee (CCITT), Group 4 compression represents an advancement over earlier fax standards like Group 3, which relied on one-dimensional or optional two-dimensional encoding with error correction mechanisms.[1] By using exclusively two-dimensional encoding—comparing each scan line to the previous one to encode differences and repeating patterns—it eliminates the need for end-of-line markers and synchronization, resulting in smaller file sizes and faster processing compared to its predecessor.[3]
The algorithm operates on 1-bit monochrome images, making it ideal for typographic text, diagrams, and binary graphics, but unsuitable for color or grayscale content.[1] It employs Huffman-like variable-length coding to represent runs of black and white pixels efficiently, with special modes for handling vertical transitions and extensions for horizontal runs.[3] No patents or licensing fees are required for its implementation, contributing to its widespread adoption since the 1980s.[1]
Group 4 compression is integral to several key file formats and applications, including Tagged Image File Format (TIFF) variants like TIFF_G4 for archival document imaging,[4] Portable Document Format (PDF) via the /CCITTFaxDecode filter,[5] and legacy fax transmission systems.[2] It remains a preferred choice in digital libraries, such as those of the Library of Congress, for preserving bitonal scans due to its balance of compression efficiency and fidelity.[1] Despite the rise of more versatile modern codecs, its simplicity and reliability ensure continued use in specialized document workflows.[3]
Overview
Definition and Purpose
Group 4 compression, formally defined in ITU-T Recommendation T.6 as the standard for facsimile coding schemes and control functions in Group 4 facsimile apparatus, is a two-dimensional lossless compression algorithm specifically tailored for black-and-white (1-bit per pixel) raster images.[2] It employs the Modified Modified READ (MMR) coding method, which refines earlier run-length encoding techniques to predict and encode pixel patterns across multiple lines without any data loss.[1]
The primary purpose of Group 4 compression is to minimize data volume by exploiting spatial redundancies inherent in bitonal images, such as those found in text documents and line art, enabling efficient storage and transmission while preserving every detail of the original image.[1] This lossless approach ensures perfect reconstruction, making it ideal for applications requiring fidelity, like document archiving.[6] It typically achieves compression ratios on the order of 15:1 for standard text-heavy pages, significantly reducing bandwidth needs compared to uncompressed formats.[1]
For instance, a standard 8.5" × 11" page scanned at 200 DPI generates an uncompressed bitonal image of approximately 467.5 kB.[7] Developed in the context of facsimile technology, it was created for error-free transmission over low-bandwidth channels, extending the one-dimensional methods of Group 3 standards to incorporate two-dimensional referencing for enhanced efficiency.[2]
Key Characteristics
Group 4 compression, also known as Modified Modified READ (MMR), is a lossless technique that enables the exact reconstruction of the original image data without any loss of information. This property ensures that the decompressed output matches the input bit-for-bit, making it suitable for applications requiring fidelity to the source material.[1][8]
The algorithm is specifically designed for bitonal images, which consist of 1-bit per pixel representations where each pixel is either black or white, effectively treating the image as a series of binary strips. Unlike general-purpose compression methods that handle multi-level grayscale or color data, Group 4 operates exclusively on this bilevel format to exploit the inherent redundancies in black-and-white imagery.[1][8]
A defining feature is its two-dimensional encoding approach, which analyzes correlations not only within a single scan line but also between consecutive lines to identify and encode redundancies more efficiently than one-dimensional methods. This inter-line dependency allows for higher compression ratios by predicting pixel values based on reference lines, distinguishing it from simpler run-length encoding schemes.[1][8] Standardized under ITU-T Recommendation T.6, this method streamlines the bitstream by omitting end-of-line (EOL) markers that are present in prior standards, thereby reducing overhead and producing a more compact, continuous data flow without per-line delimiters.[8]
Group 4 compression exhibits high sensitivity to transmission errors due to the absence of built-in error detection or correction mechanisms, such as synchronization codes or redundant checks found in earlier facsimile standards. It assumes a reliable channel for data transfer, where any bit error can propagate and corrupt subsequent decoding, potentially affecting large portions of the image.[6][8]
History and Development
Origins in Fax Standards
Group 4 compression emerged in the 1980s as part of the CCITT's (now ITU-T) initiatives to enhance facsimile efficiency beyond the capabilities of Group 3 standards, which had introduced digital techniques but still faced limitations in speed and compression for widespread adoption.[9] This development was driven by Study Group XIV, responsible for facsimile telegraph transmission and equipment, during its 1981–1984 study period, building on prior work from the 1977-1980 period, where efforts focused on advancing image coding for better performance in document transmission.[9]
The algorithm derived directly from the two-dimensional compression scheme in Group 3 (G3-2D), known as Modified READ (MR), which encoded differences between a reference line and the current scan line to exploit vertical and horizontal redundancies in bilevel images.[1] Group 4 extended this by introducing Modified Modified READ (MMR), eliminating the need for end-of-line markers and allowing unlimited reference lines, thereby achieving higher compression ratios without error correction overhead.[1] It builds on the Huffman coding foundations from Group 3 for run-length encoding of black and white pixel sequences.[1]
The primary motivation was to enable higher compression levels in Group 4 facsimile machines, supporting higher transmission rates up to 64 kbps over digital networks like ISDN while maintaining interoperability for digital fax systems.[9] A key milestone came from initial proposals by CCITT Study Group XIV in the early 1980s, which emphasized digital fax interoperability to facilitate global document exchange in office environments, addressing the growing demand for efficient, error-free transmission.[9]
Standardization Process
The standardization of Group 4 compression was formalized through the efforts of the International Telegraph and Telephone Consultative Committee (CCITT), the predecessor to the ITU Telecommunication Standardization Sector (ITU-T), which coordinated input from telecommunications experts across multiple countries during sessions spanning 1981 to 1984. Recommendation T.6 was first adopted by CCITT in 1984 during the Malaga-Torremolinos meeting and amended at Melbourne in 1988. This collaborative process culminated in the publication of the amended ITU-T Recommendation T.6 in November 1988, officially titled "Facsimile coding schemes and coding control functions for Group 4 facsimile apparatus," which provided the precise specification for the algorithm and its control mechanisms.[1][2][10]
Building on the foundational one-dimensional coding from Recommendation T.4 for Group 3 facsimile, T.6 introduced two-dimensional encoding to enhance efficiency for digital networks. The standard was integrated into broader file formats shortly thereafter, including adoption in the Tag Image File Format (TIFF) as Compression Type 4 in 1988 to support bilevel image storage. Later, it was incorporated into the Portable Document Format (PDF) specification from version 1.0 onward in 1993, enabling its use for compressed embedded monochrome images in documents.[11]
Minor revisions to Recommendation T.6 followed in subsequent years, such as a March 1993 reprint for editorial clarifications, with no changes to the core compression algorithm since 1988. These amendments ensured ongoing compatibility and precision in implementation across international facsimile systems.[10]
Algorithm and Encoding
Principles of 2D Compression
Group 4 compression, also known as Modified Modified READ (MMR), employs two-dimensional (2D) encoding to exploit the correlation between consecutive scan lines in bilevel images, such as those in facsimile documents. Unlike one-dimensional methods that treat each line independently, 2D compression predicts the current coding line based on the immediately preceding reference line, encoding only the differences to achieve higher efficiency. This approach assumes that adjacent lines share significant continuity, particularly in text and line art where features like characters extend vertically across rows.[2][12]
In the scan line processing, the image is divided into horizontal scan lines of fixed width, typically 1728 pixels for standard fax resolutions. The first line is encoded using one-dimensional run-length encoding, while subsequent coding lines are processed relative to the previous line, which serves as the reference. Transitions between black and white pixels in the coding line are identified starting from a reference point (a0), and only deviations from the predicted positions in the reference line are encoded, minimizing the data required for redundant regions. This predictive method leverages the spatial redundancy in the vertical direction, encoding differences rather than full run lengths for each line.[2][12]
The encoding utilizes three primary modes to handle transitions: vertical, horizontal, and pass. In vertical mode, if a transition in the coding line aligns closely (within three pixels) with one in the reference line, the position is encoded relative to it, indicating minimal change and exploiting vertical continuity. Horizontal mode is invoked when the alignment exceeds this threshold, falling back to run-length encoding of the black and white runs from the current reference point to the next two transitions in the coding line. The pass mode skips encoding a transition if it matches a position in the reference line, advancing the reference point without additional data. These modes are selected dynamically based on the changing elements' positions, with run-length encoding applied specifically to the horizontal mode for specifying run lengths of transitions between black and white pixels. Variable-length codes, assigned via Huffman coding principles, are used to represent these modes and run lengths efficiently.[2][12]
The reference line assumption in Group 4 compression posits a predominantly white background with sparse black features, such as text or graphics, allowing the algorithm to predict continuity between lines effectively. An imaginary all-white extension is assumed to the left of the reference line to handle edge cases, ensuring consistent starting points for prediction. This model is particularly suited to document images where vertical correlations are strong, reducing the encoded differences in uniform or aligned regions.[2][12]
The encoding process produces a continuous bitstream for the entire image without end-of-line (EOL) markers after each coding line, concluding with an end-of-facsimile block (EOFB).[2][12]
Encoding Mechanisms
The encoding process in Group 4 compression, also known as Modified Modified READ (MMR), begins by initializing the reference line as an all-white imaginary row above the first coding line. For each subsequent coding line, the algorithm identifies changing elements, which are the positions where the pixel color transitions from white to black or vice versa, denoted as a0 (the starting position of the current run), a1 (the next transition in the coding line), and a2 (the transition following a1). These are compared to corresponding elements b1 and b2 in the reference line to determine the spatial relationship and select an appropriate encoding mode. The selected mode's code is then output as Huffman-coded bits, advancing the reference line to the current coding line after processing the entire line. This process repeats until the end of the page, with the bitstream padded to byte boundaries if necessary.[13]
MMR, as defined in ITU-T Recommendation T.6, refines the two-dimensional coding of Group 3 by removing all end-of-line (EOL) markers and return-to-control (RTC) sequences, treating the entire page as a continuous bitstream without line-by-line delineation. Unlike Group 3's optional one-dimensional mode, MMR exclusively uses two-dimensional encoding with an infinite value for the K parameter (number of consecutive two-dimensional lines), eliminating the need for mode-switching indicators. The page concludes with a unique end-of-facsimile block (EOFB) consisting of two consecutive Group 3 EOL codes (000000000001), signaling the termination without RTC padding. This streamlined approach enhances efficiency for error-free transmission channels like digital networks.[1][6]
The mode selection depends on the relative positions of the changing elements: if the interval between b1 and b2 in the reference line lies entirely to the left of the interval between a1 and a2 (with b2 < a1), the pass mode (code: 0001) is used, skipping the current change and advancing a0 to the position under b2. For vertical alignment where the intervals overlap by at most three pixels, a vertical mode is chosen: V0 (code: 1) for exact alignment (a1 = b1), VR1/VR2/VR3 (codes: 011, 000011, 0000011) for right shifts of 1-3 pixels (a1 = b1 + offset), or VL1/VL2/VL3 (codes: 010, 000010, 0000010) for left shifts (a1 = b1 - offset), setting a0 to a1 in each case. If the overlap exceeds three pixels or no vertical fit applies, the horizontal mode (code prefix: 001) encodes the run lengths from a0 to a1 and a1 to a2 using separate Huffman codes for white and black runs, advancing a0 to a2. An extension mode (code prefix: 0000001111) allows for uncompressed data if enabled via optional flags, though it is rarely used.[13][14]
Run lengths in horizontal and pass modes are encoded using fixed Huffman tables shared with Group 3, separating terminating codes (for runs of 0-63 pixels) from makeup codes (for multiples of 64 pixels up to 1792, combinable for longer runs). For white runs, the terminating code for length 0 is 00110101, for 1 is 000111, and for 2 is 011; makeup for 64 whites is 11011. For black runs, terminating code for 0 is 0000110111, for 1 is 000110; makeup for 64 blacks is 0000001110111. These codes prioritize frequent short runs with shorter bit lengths, achieving variable-length prefix-free encoding. Full tables are specified in ITU-T T.4 and reused in T.6 for consistency.[14][6]
A pseudocode outline for processing a single coding line illustrates the iterative mode selection:
Initialize a0 = 0, reference line as all white
While a0 < line width:
Find [a1](/page/A1) (first transition after a0), a2 (next after a1)
Find [b1](/page/B1) (first reference transition at/after a0), b2 (next after b1)
If b2 < a1: // Pass mode
Output pass code (0001)
Set a0 = b2
Else if |a1 - b1| <= 3: // Vertical mode
Output vertical code based on a1 - b1 (V0, VRn, or VLn)
Set a0 = a1
Else: // [Horizontal](/page/Horizontal) mode
Output horizontal prefix (001)
Output Huffman code for a0 to a1 run
Output Huffman code for a1 to a2 run
Set a0 = a2
If line is all white, output special all-white code if applicable (handled implicitly via zero transitions)
Initialize a0 = 0, reference line as all white
While a0 < line width:
Find [a1](/page/A1) (first transition after a0), a2 (next after a1)
Find [b1](/page/B1) (first reference transition at/after a0), b2 (next after b1)
If b2 < a1: // Pass mode
Output pass code (0001)
Set a0 = b2
Else if |a1 - b1| <= 3: // Vertical mode
Output vertical code based on a1 - b1 (V0, VRn, or VLn)
Set a0 = a1
Else: // [Horizontal](/page/Horizontal) mode
Output horizontal prefix (001)
Output Huffman code for a0 to a1 run
Output Huffman code for a1 to a2 run
Set a0 = a2
If line is all white, output special all-white code if applicable (handled implicitly via zero transitions)
This loop continues until a0 reaches or exceeds the line width, ensuring complete coverage.[13]
Edge cases, such as all-white lines or image boundaries, are handled by implicit zero-length runs or special provisions: an all-white coding line relative to an all-white reference produces no output bits beyond advancing to the next line, while boundaries use imaginary white pixels beyond the width to complete codes without overscan errors. The initial all-white reference avoids explicit coding for uniform starts, and the final EOFB ensures clean page termination even at uneven widths.[1][6]
Applications
Fax Transmission
Group 4 compression is integral to facsimile technology, particularly in Group 4 fax machines designed for digital networks such as ISDN, where it enables the efficient transmission of A4-sized documents at rates up to 64 kbps. This allows a typical page to be sent in less than 10 seconds, a dramatic reduction from the minutes required for uncompressed transmission at equivalent bit rates, thanks to compression ratios often exceeding 10:1 for text-heavy documents.[15][16][17]
The T.30 protocol integrates seamlessly with Group 4 compression by negotiating the G4 mode during the handshaking phase, where devices exchange capabilities to select the encoding scheme and ensure compatibility. This process supports error-free delivery over purely digital lines, eliminating the need for analog modulation and associated signal distortions common in earlier fax standards.[18][19]
Implementation in Group 4 fax machines requires hardware equipped with digital signal processors within modems to perform real-time encoding and decoding of the compressed data stream, facilitating high-speed processing without buffering delays on digital circuits.[20][21]
Adopted as an ITU-T standard in 1988 following development from 1981 to 1984, Group 4 fax gained widespread use in 1990s office settings for its reliability and speed over digital infrastructure, though it has since become legacy technology while remaining supported in modern hybrid systems combining analog, digital, and IP networks.[15][2]
Group 4 compression, also known as CCITT T.6, is integrated into the Tagged Image File Format (TIFF) as Compression tag value 4, enabling efficient storage of bilevel raster images such as scanned documents. This support was formalized in the TIFF 6.0 specification released in 1992, which designates it for facsimile-compatible encoding of black-and-white images, often used for line art and text-heavy content in document archiving.[4] TIFF files employing Group 4 compression support multi-page structures, facilitating the organization of sequential document pages into a single file for interchange and long-term preservation.
In Portable Document Format (PDF), Group 4 compression is specified for encoding 1-bit image masks and monochrome raster data, particularly in PDF/A standards designed for archival purposes.[5] ISO 32000-1:2008, which aligns with PDF 1.7, explicitly includes CCITT Group 4 as a lossless compression option for bilevel images, making it suitable for embedding scanned documents in self-contained, searchable files. This integration ensures compliance with long-term digital preservation requirements, where unaltered image fidelity is essential.
Beyond TIFF and PDF, Group 4 compression appears in specialized formats like the Continuous Acquisition and Life-cycle Support (CALS) Type 1 raster format, a U.S. Department of Defense standard for engineering drawings that employs CCITT T.6 for compact monochrome storage.[22] Similarly, Intergraph's Computer Image Technology (CIT) format, particularly Raster Type 24, utilizes Group 4 encoding for high-compression handling of binary raster data in CAD and geospatial applications.[23] These formats served as precursors to more advanced bi-level compression schemes like JBIG, bridging fax-era techniques to modern image handling. In practice, Group 4 compression in TIFF files typically yields file sizes about 50% smaller than equivalent Group 3 encodings for similar scanned content, demonstrating its efficiency for archival use.[24]
Software libraries and tools widely implement Group 4 encoding and decoding to support these formats. The libtiff library provides robust handling of Compression=4, including options for 2D encoding tailored to bilevel TIFF images. Ghostscript, a PostScript and PDF interpreter, incorporates Group 4 support for generating and processing compressed TIFF and PDF outputs, often integrated into workflows for document conversion. These capabilities extend to applications like Adobe Acrobat, which leverages such libraries to apply Group 4 compression during PDF creation from scanned sources, ensuring optimized file sizes without loss of detail.
Differences from Group 3
Group 4 compression employs a pure two-dimensional (2D) encoding approach using Modified Modified READ (MMR), without any one-dimensional (1D) fallback mechanism. In comparison, Group 3 compression mixes 1D encoding via Modified Huffman (MH) for independent line compression with 2D encoding via Modified READ (MR) for inter-line correlations, requiring end-of-line (EOL) markers after each line to delineate boundaries.[1][25]
By eliminating EOL and return-to-control (RTC) codes, Group 4 reduces transmission and storage overhead compared to Group 3, which mandates these elements for synchronizing lines and signaling page ends. This omission in Group 4 streamlines the bitstream but forgoes the structured markers that aid in parsing.[25][1]
Group 3 incorporates optional error handling, such as resetting to 1D mode upon error detection, which limits damage propagation in noisy transmission channels. Group 4 provides no such recovery features, rendering it unsuitable for environments with potential bit errors.[25][3]
Decoding Group 4 requires access to the previous line due to MMR's reliance on referencing it, increasing computational demands compared to Group 3's 1D mode. Group 3 supports line-by-line processing in its 1D mode, allowing incremental decoding without prior line data.[26][25]
Both Group 3 and Group 4 utilize shared Huffman tables for encoding run lengths of black and white pixels.[25]
Efficiency Metrics
Group 4 compression, also known as CCITT T.6 or Modified Modified READ (MMR), typically achieves compression ratios on the order of 15:1 for bitonal images, such as scanned documents or line art, by leveraging two-dimensional run-length encoding to exploit vertical correlations between scan lines.[1] This efficiency stems from its ability to reference the previous line for encoding transitions, resulting in smaller file sizes compared to one-dimensional methods.[6]
In comparisons with Group 3 (CCITT T.4), Group 4 delivers roughly twice the compression efficiency, often halving the file size for the same document while achieving ratios upwards of 15:1 versus 5:1 to 8:1 for standard 200-dpi A4 text pages under Group 3.[6] For text-heavy pages, average ratios reach approximately 20:1, while sparse images with long runs of uniform pixels can exceed 50:1, as demonstrated by encoding examples where 8800 consecutive black pixels compress at 144:1.[6] Product documentation from imaging software vendors corroborates this, noting Group 4 rates up to three times higher than Group 3 for monochrome content.[27]
Benchmarks on TIFF files highlight practical performance: in a study of 56 1-bit archival images (e.g., microfilm scans of text), Group 4 reduced mean file sizes to 12.68% of uncompressed equivalents (range 0.05%–47.15%), equating to an average ratio of about 7.9:1, with extremes from 2.1:1 to over 2000:1 depending on image entropy.[28] though it underperforms general-purpose compressors like LZW or ZIP on about 20% of high-entropy 1-bit files.[28]
| Metric | Group 4 (T.6) | Group 3 (T.4) | Context/Source |
|---|
| Typical Ratio (Text Pages) | 15:1 to 20:1 | 5:1 to 8:1 | Standard 200-dpi A4 documents[6] |
| Mean File Size (% of Uncompressed) | 12.68% (range 0.05–47.15%) | N/A | 1-bit TIFF benchmarks (56 files)[28] |
| Relative Efficiency | Twice as efficient | Baseline | Same document comparison[6] |
| Max Ratio (Sparse) | Up to 144:1+ | Lower (e.g., 20:1 for short runs) | Long uniform runs example[6] |
Encoding with Group 4 is more computationally intensive than Group 3 due to line-to-line analysis, making it suitable for offline or batch processing rather than real-time transmission, though specific speed multipliers vary by implementation.[26] In worst-case scenarios with high-frequency patterns like dithered halftones, ratios drop to 3:1 or below, potentially increasing file sizes slightly over uncompressed for highly noisy bitonal data.[6]
Limitations
Technical Drawbacks
One significant technical drawback of Group 4 compression, also known as Modified Modified READ (MMR), is the absence of any built-in error correction capability. A single bit error in the compressed bitstream can propagate and corrupt the entire decoded image, as the algorithm lacks mechanisms like the return-to-control (RTC) codes used in Group 3 compression to resynchronize at the start of each line in noisy channels. This design assumes transmission over virtually error-free digital networks, such as ISDN, making it unsuitable for environments with potential bit errors without additional external error protection.[29]
Another limitation arises in worst-case scenarios where specific pixel patterns lead to data expansion rather than compression. For instance, an alternating pattern of single-pixel black and white dots offset by one pixel between lines—a 1-pixel checkerboard—forces the 2D reference encoding to generate numerous short runs, resulting in a larger encoded size than the original uncompressed data. To mitigate this negative compression effect, some implementations, such as those in the JEDMICS C4 specification, detect such cases and store affected image tiles in uncompressed form.[30]
The 2D dependency inherent to Group 4 encoding imposes substantial processing overhead, particularly for random access operations. While decoding within an encoded block requires sequential processing from its start due to 2D dependencies, container formats like TIFF support random access via independently decodable strips or tiles. This reduces but does not eliminate latency and resource demands in applications requiring partial image rendering or editing.[31]
The encoded stream requires byte alignment, often necessitating padding of scanlines to multiples of 8 bits (equivalent to white pixels) if the image width does not result in a multiple of 8 bits per line, which can reduce efficiency for non-standard widths deviating significantly from traditional fax widths (e.g., 1728 pixels for A4), as the added fill inflates the data size without contributing to the actual content.[31]
Additionally, Group 4 compression is inherently restricted to bitonal (1-bit per pixel) images, precluding direct application to higher-depth content without prior dithering or conversion, which can introduce artifacts.[1]
Usage Constraints
Group 4 compression is inherently designed for monochrome bilevel images, consisting of black and white pixels without support for color, grayscale, or continuous-tone content. Applying it to non-monochrome images requires prior conversion, such as dithering to approximate shades with patterns of black and white pixels, which can introduce artifacts and reduce effective compression efficiency.[4][32]
As a technology primarily associated with Group 4 facsimile standards from the 1980s, Group 4 compression sees limited use in traditional analog fax but remains supported in IP-based protocols like T.38 and specialized archival and imaging software as of 2025.[33][3]
The compressed data from Group 4 cannot exist as a standalone file format and must be encapsulated within container structures such as TIFF or PDF to include necessary metadata like resolution and page dimensions. In legal and archival contexts, it is preferred for PDF/A-1b compliance due to its lossless nature and baseline support in PDF 1.4, ensuring long-term accessibility for scanned monochrome documents. Despite these constraints, Group 4 remains recommended for long-term preservation of bitonal documents in formats like PDF/A, with support in current software as of 2025. However, newer standards like JBIG2 provide superior compression ratios—often 2 to 5 times better for similar bilevel content—while maintaining compatibility in updated archival workflows.[4][34][4]
Its design without built-in error correction mechanisms makes Group 4 particularly sensitive to transmission errors, potentially corrupting entire pages if bit errors occur.[35]