By Topic

• Abstract

SECTION I

## INTRODUCTION

For long term storage and efficient transmission of data, data compression is critical. Over the past decade, several compression techniques have been proposed. Some of the researchers focused on general data compression, while others designed more specific file compression techniques for movies, sound, and image files. When a file type is known, better compression results can be attained with less effort because better prediction models can be designed.

Color image quantization [1], [2] is an essential technique for low-cost display devices. A low-cost display device has limited ability. For example, there are 16.8 million $(2^{24})$ possible color combinations in an RGB color image. Since an RGB color image consists of three bytes for each pixel; one byte for each color (red, blue, and green), a color image quantization is applied to map 24 bits to 16, 8, or 4 bits per pixel.

A color image quantization is a three-step process: the first step is designing a suitable palette to reduce the number of colors, the second step is coding, and the final step is decoding. For each RGB image, by generating a set of representative colors, a palette is formed. Later, the palette is used in image encoding and decoding. In the encoding process, each color pixel in the RGB image is replaced with the index of the closest color in the palette. In effect, each RGB color pixel is represented by an index, which is mapped to the color palette. If the palette size is 256 or less, each index can be represented with a byte. Hence, effectively, image size is reduced from 3 bytes per color to one byte per index value by applying the quantization. In quantization process, we may have quantization errors, e.g., distortion. To overcome quantization errors, dithering algorithms are used. In a dithered image, colors not available in the palette are approximated by a diffusion of colored pixels from within the available palette. The human eye perceives the diffusion as a mixture of the colors within it.

In recent years, several dithering algorithms were proposed. The most well-known algorithm [3] was developed in 1976 by Floyd–Steinberg, which is known as the Floyd–Steinberg dithering technique in literature. It uses error-diffusion algorithms instead of basic dithering algorithms [2], such as average, ordered, or random, and produces images which look closer to original form. In [4], for color error diffusion problem, a vector-based approach was proposed by Akarun et al. In [5], Alasseur showed that noise shaping method improves the image quality, while in [6], Yao proposed a method which provides optimal solution for the error diffusion problem.

In World Wide Web, many Web pages use quantized images. They are stored and transmitted after they are compressed losslessly with the standard Graphics Interchange Format (GIF) or Portable Network Graphics (PNG). Since GIF was patented, the PNG format was designed to replace GIF as an improved and patent-free alternative. The PNG file for an image is usually 10%–35% smaller than the GIF file for the same image. These algorithms fail to obtain good compression gain, e.g., GIF standard uses Lempel–Ziv compression, which treats the image as a 1-D sequence of index values, ignoring the 2-D nature. Besides GIF and PNG, several researchers proposed different methods for quantized images. According to the survey paper of Pinho and Neves [7], Memon's and Venkateswaran's re-indexing scheme yields the best compression gain when JPEG-LS or JPEG-2000 is used after the re-indexing method. Memon and Venkateswaran [8] treated the problem as a general smoothness maximization problem, while Zeng et al. method [9] used re-indexing based on index-differences. All these methods show that reordering and re-indexing help 2-D compression schemes. In [10], Battiato et al. show that PNG yields better compression than JPEG-based techniques on re-indexed color-mapped images.

While several different techniques have been explored for color quantized and dithered images, the use of pseudo-distance metric has not been investigated for dithered images since it was proposed by Kuroki et al. [11]. In our earlier work [12], [13], we showed that better compression gain than other techniques can be obtained when pseudo-distance technique (PDT) is applied to color-mapped images. In [14], we examined PDT for images with different dithering techniques. By using a dynamic color-table, we obtained better results than the other well-known techniques, such as GIF and PNG. In this paper, we show that further improvement on compression gain is possible when the color-table is updated based on the neighboring pixels.

This paper is planned as follows: In Section 2, the description of the PDT and a prediction algorithm along with a modified PDT for encoding images are presented. In Section 3, decoding process is explained. In Section 4, the coder we employed is described. In Section 5, the presentation of our experimental result is given, and in Section 6, the conclusions of our paper are summarized.

SECTION II

## ENCODING ALGORITHM

First, we form a distance matrix ${\bf D}$ as shown in Table 1, by calculating Euclidean distance [12] between every pair of indices from a color palette (color-map table). In each row of ${\bf D}$, there may be similar values. To overcome the problem of non-uniqueness of the entries in rows of ${\bf D}$, we compute a corresponding pseudo-distance matrix ${\bf P}$, where each row element P $(a, b)$ gets a unique value $c\ (0 \leq c \leq 255)$ based on the rank of D $(a, b)$ in the sorted row $a$ of matrix ${\bf D}$, as shown in Table 2.

TABLE 1 EXAMPLE OF A DISTANCE MATRIX ${\bf D}$
TABLE 2 PSEUDO-DISTANCE MATRIX ${\bf P}$

Currently used prediction-based image compression techniques usually predict the current pixel $x$ by using some neighbors of $x$, as shown in Fig. 1. In [11], Kuroki et al. used the pixel $a$ (reference) and $x$ to determine a prediction error $e$ from the pseudo-distance matrix, as shown in Fig. 2.

Fig. 1. Predicted pixel x and reference neighboring pixels.
Fig. 2. Ranking with pseudo-distance matrix ${\bf P}$.

Instead of using $a$ as the reference pixel for determining $x$, if we choose the minimum of $\{{\rm P}(a, x), {\rm P}(c, x)\}$ for each color-index $x$, compression gain can be improved further. But this decision requires transmission of extra information, which reverses the gains obtained from selecting the minimum of $\{{\rm P}(a, x), {\rm P}(c, x)\}$. In [12], to avoid any overhead, we employed Gradient Adjusted Predictor (GAP). The goal of a predictor algorithm is to predict $x$ with the minimum possible error. We experimented with various techniques, including, for instance, the Paeth algorithm [15], to construct a superior prediction scheme. We concluded that the P redict method below results in the best prediction of x from its neighbors:

In [14], we used a procedure in PDT with dynamic pseudo-distance matrix. Recently, our experiments showed that a further compression gain over our work in [14] is possible, when the matrix is updated using the Pseudo-Distance-Transform method below:

This algorithm, while preserving the uniqueness of entries of the rows, may increase the number of zeros when the same colors occur again as neighbors.

SECTION III

## DECODING ALGORITHM

The decoding process reconstructs the original image file as follows: By using the index table, first, we construct the pseudo-distance matrix ${\bf P}$. Let $r$ be the first value retrieved from the index table. In encoding process, $r$ was encoded as a raw byte. To recover the first row and first column of the image, we first receive the error signal $e$ of the next pixel from the encoded image. Then, in row $r$ of the pseudo-distance matrix, we search for the error signal value $e$. Upon determining $e$ in row $r$, we emit the corresponding column value $x$ as the original index value for the image to be reconstructed. Finally, we let $x$ be $r$. These steps are formalized in the Reverse-Pseudo-Distance-Transform method:

After this process, we attain first row and first column values of the original image. To decode the rest of the rows, the following procedure is applied:

Finally, the original color-mapped image is reconstructed by the decoding algorithm without losing any information.

SECTION IV

## CODER

In compression of transformed image data, we used context-based binary arithmetic coder (BAC) with a run-length encoder (RLE). The use of RLE is vital in entropy coder phase since the output of the PDT on dithered images contains a significant number of zeros. RLE detects long run sequences and regroup the repetitive sequences. It also improves the context-based arithmetic coder (AC) performance by helping the AC in determining non-zero symbol probabilities. While the use of RLE improves compression gain, it also decreases the computation time of the entropy coder. Fenwick proposed a special run-length encoding algorithm on 0 s and 1 s in [16]. In [17], the zero-run-length transformed data were used along with the context-based AC. In this paper, we used a binary AC (BAC) with run-length encoding algorithm similar to the one in [17]. The steps involved compressing an image are depicted schematically in Fig. 3.

Fig. 3. Steps in encoding of an image.
SECTION V

## EXPERIMENTAL RESULTS

In this paper, we evaluated the performance of our algorithm on a set of commonly used test images. These images were obtained from ftp://ftp.ieeta.pt/~ap/images/. They were converted from the portable pixel map (PPM) format to color-index-based bitmap (BMP) format using Gimp (ver. 2.6.11). In conversion process, the Floyd–Steinberg, the Floyd–Steinberg reduced color, and the positioned dithering techniques were used.

The Paeth prediction algorithm is used in PNG, while GAP is used in CALIC, and Median is used in JPEG-LS to determine which color index is used in prediction of $x$. In PDT transformation phase, we experimented with these prediction algorithms. However, when we applied the Predict algorithm, we improved compression gain than the other predictors.

After the PDT transformation, the zero value is dominant. Since we obtained more zeros with the transformation, we applied a context-modeled BAC with an RLE, as in [17], on the PDT transformed dithered images to take advantage of zeros. Using this process, we achieved better compression gain than the well-known image compression schemes, such as GIF, PNG, JPEG-LS, and JPEG2000. In Tables 35, we present the results of our experiments.

TABLE 3 COMPRESSION RESULTS OF IMAGES DITHERED WITH FLOYD–STEINBERG (NORMAL) METHOD, IN BITS PER PIXEL (BPP)
TABLE 4 COMPRESSION RESULTS OF IMAGES DITHERED WITH FLOYD–STEINBERG (REDUCED COLOR BLEEDING) METHOD, IN BITS PER PIXEL (BPP)
TABLE 5 COMPRESSION RESULTS OF IMAGES DITHERED WITH POSITIONED DITHERING METHOD, IN BITS PER PIXEL (BPP)
SECTION VI

## CONCLUSION

The PDT is an efficient lossless image compression method for color-palette images since the PDT runs in linear time and requires only one-pass [11]. In our previous work [14], we have shown that, when the PDT is used in conjunction with a context-model BAC, we obtained better compression results than the well-known image compressors such as GIF, PNG, JPEG-LS, and JPEG2000 on dithered images. In this paper, we have shown that further compression gains are possible when we update one more neighbor of the predicted pixel in PDT matrix. Indeed, with this modification, on three sets of dithered images, we have achieved on average 3.9% improvement over our previous work resulting in total gains of 46.8% over GIF and 14.2% over PNG.

## Footnotes

Corresponding author: B. Koc (e-mail: b.koc@umiami.edu).

## References

No Data Available

## Cited By

No Data Available

None

## Multimedia

No Data Available
This paper appears in:
No Data Available
Issue Date:
No Data Available
On page(s):
No Data Available
ISSN:
None
INSPEC Accession Number:
None
Digital Object Identifier:
None
Date of Current Version:
No Data Available
Date of Original Publication:
No Data Available