Lossless Image Compression Using Multi-level Dictionaries: Binary Images

Samar Agnihotri,Renu Rameshan,Ritwik Ghosal
2024-09-11
Abstract:Lossless image compression is required in various applications to reduce storage or transmission costs of images, while requiring the reconstructed images to have zero information loss compared to the original. Existing lossless image compression methods either have simple design but poor compression performance, or complex design, better performance, but with no performance guarantees. In our endeavor to develop a lossless image compression method with low complexity and guaranteed performance, we argue that compressibility of a color image is essentially derived from the patterns in its spatial structure, intensity variations, and color variations. Thus, we divide the overall design of a lossless image compression scheme into three parts that exploit corresponding redundancies. We further argue that the binarized version of an image captures its fundamental spatial structure. In this first part of our work, we propose a scheme for lossless compression of binary images. The proposed scheme first learns dictionaries of $16\times16$, $8\times8$, $4\times4$, and $2\times 2$ square pixel patterns from various datasets of binary images. It then uses these dictionaries to encode binary images. These dictionaries have various interesting properties that are further exploited to construct an efficient and scalable scheme. Our preliminary results show that the proposed scheme consistently outperforms existing conventional and learning based lossless compression approaches, and provides, on average, as much as $1.5\times$ better performance than a common general purpose lossless compression scheme (WebP), more than $3\times$ better performance than a state of the art learning based scheme, and better performance than a specialized scheme for binary image compression (JBIG2).
Information Theory,Computer Vision and Pattern Recognition,Machine Learning
What problem does this paper attempt to address?
### Problems Addressed by the Paper The paper aims to address the trade-off between performance and complexity in lossless image compression. Existing lossless image compression methods are either simple in design but perform poorly, or complex in design with better performance but lack performance guarantees. The authors propose a new lossless binary image compression scheme that features low complexity and performance guarantees. ### Main Contributions 1. **Proposed a new paradigm for lossless image compression**: Designed an overall compression scheme by leveraging the spatial structure, intensity variations, and color variation patterns of the image layer by layer. 2. **Demonstrated that the basic spatial structure of an image is captured by its binary version**: Argued that the main spatial structure of an image can be represented by its binary version. 3. **Proposed a lossless binary image compression method based on multi-level dictionary learning**: Learned dictionaries of image blocks of different sizes (16×16, 8×8, 4×4, 2×2) and used these dictionaries to encode binary images. 4. **Experimental results show that the method performs excellently in various benchmarks**: The average performance is 1.5 times higher than general lossless compression schemes (such as WebP) and more than 3 times higher than the state-of-the-art learning-based methods, outperforming schemes specifically designed for binary image compression (such as JBIG2). ### Method Overview 1. **Multi-level Dictionary Learning**: - Learn dictionaries of image blocks of different sizes (16×16, 8×8, 4×4, 2×2) from various binary image datasets. - The dictionary contains string representations of image blocks and their frequencies. - Use the Otsu thresholding method to binarize RGB images, then extract image blocks and convert them to hexadecimal strings. 2. **Multi-level Image Encoding**: - Compress a given image using the constructed dictionaries. - Start with the largest image blocks (16×16) and progressively use smaller image blocks (8×8, 4×4, 2×2) for encoding. - For each image block, if found in the dictionary, replace it with the corresponding Canonical Huffman code; otherwise, decompose it into smaller image blocks for further processing. ### Experimental Results - Compared to existing lossless compression algorithms (such as PNG, WebP, JPEG-XL, JBIG2), this method shows significant performance advantages across multiple datasets. - Particularly in binary image compression, this method not only outperforms general compression schemes but also surpasses schemes specifically designed for binary image compression (such as JBIG2). ### Statistical Analysis - **Local Similarity of Natural Images**: Natural images are often modeled as Markov Random Fields (MRF), meaning that the values of neighboring pixels are usually similar. - **Boundedness of the Dictionary**: Although a large number of unique patterns may be observed, only a few patterns appear frequently, keeping the dictionary size manageable. - **Statistical Distribution of Pattern Frequencies**: For image blocks of different sizes (2×2, 4×4, 8×8, 16×16), the number of high-frequency patterns is relatively small, while the number of low-frequency patterns is larger. ### Conclusion The paper proposes a new lossless binary image compression method that achieves low complexity and high performance through multi-level dictionary learning and encoding. Experimental results show that the method performs excellently in various benchmarks and has broad application prospects.