Paul J. Aubeck Jr. developed a technique for lossless compression of color-indexed images named Piecewise-constant Image Model (PWC) [2, 3, 4].
51 Whether synthetically produced or obtained from continuous tone natural images, palette images are characterized by the following properties:
• They tend to contain fewer colors than pixels; • Pixels of the same color tend to be contiguous;
• The color of a pixel is statistically related to the colors of its neighbors.
The PWC captures these characteristics in a two pass model. In the first image pass, bound- aries between constant color pieces (or domains) are established. In the second pass, the color of each domain is evaluated.
The PWC coding language is composed of four decisions that we present next:
• D1 Is the color of the current pixel identical to that of a specified rectilinear connect
neighbor?
• D2 Is the color of the current pixel identical to that of a specified diagonally connect
neighbor?
• D3 Is the color of the current pixel identical to a guessed value? • D4 What is the color of the current pixel?
D1 decisions are used to establish the boundaries between constant color domains. The
decisions D2 to D4 are used to establish the color information of each domain. The decisions
D1 to D3 are binary and D4 is a composition of binary decisions.
In the following, we present the two main steps of the algorithm: the boundary coding and the color coding.
Boundary coding
The edge map used in this work represents boundary information via the introduction of imaginary edges between pixels. Each pixel is assigned one vertical and one horizontal edge in a separator lattice. In the edge map representation, binary decisions can be naturally used to determine whether or not a particular lattice site is full.
PWC populates its edge map boundary model in raster order. At each pixel location, X, the state of vertical separator site is determined first, followed by the horizontal site. Population decisions are made using D1 decisions from the PWC language. In Fig. 4.2, the two rectilinear
separator decisions are labeled D1v and D1h, respectively. Due to connectivity constraints,
D1h can often be determined deterministically. For example, if none of the three causal edges
touching the left end of separator site D1h is full, then D1h is deterministically empty. If only one of the causal edges is full, then D1h is deterministically full.
X
D1h
D1v
Figure 4.2: Edge context model in PWC.
For coding the edge map, PWC uses an arithmetic coder with a context formed by the neighboring edge segments. For each pixel X, D1 is posed against the vertical dotted edge location, as shown on Fig. 4.2, under the context determined by the eight solid edge segments on the presented in the same figure. The western edge together with the same surrounding edges form a context to pose D1 against the northern edge. The number of model parameters associated with this scheme is 256 + 512 = 768 , and the number of decisions is two per pixel. The number of model parameters and decisions of the model can be reduced (in these case the model parameters are reduced to 512) by taking advantage of boundary connectivity constraints.
Color coding
For color coding PWC uses the D2, D3 and D4 decisions. The color coding can be separated in three steps: first PWC tries to establish diagonal connectivity; if that fails, a color guessing process is attempted and finally, if color guessing fails, the color is established using predictive coding. In the following we explain these steps with more detail.
1. Diagonal Connectivity:
D2 decisions are used to establish diagonal connectivity in PWC. Diagonal connectivity
is only defined at lattice intersections where there is no rectilinear connectivity. The context model for D2 decisions uses both orientation and color information. In the Fig. 4.3 the two orientations are shown by the left and right representations and the
53 propagating color is labeled as C.
C C
X X
Figure 4.3: Diagonal context in PWC method.
2. Color Guessing:
PWC language element D3, is designed to model the neighboring color relationships in an image while using a controlled number of model parameters. A guess is simply some color that has occurred previously in the coding process.
The size of a guess model is proportional to DS, where D is the palette depth of
the image and s is the number of neighboring colors used in the model. To maintain a reasonably size of the model, the number of neighboring domain colors used to condition
D3 must be limited. For 256 color images, it is usually only beneficial to include one
neighboring color in the coding context, for example the previous domain color in the raster order.
The number of guesses maintained simultaneously by the model is limited to some fixed number. When limiting guesses, a mechanism is needed to maintain only good guesses: guesses that are mostly correct. One way to achieve this is through guess competition within a guess pool. The competitive mechanism used by PWC is a least recently used (LRU) chain. In this application, a context is moved to the front of the LRU any time its associated guess is correct. When a new guess is added to the pool and the pool has reached its maximum size, the guess at the end of the LRU chain is sacrificed.
3. Guess failures:
When diagonal connectivity and color guessing fail, PWC makes D4 decisions to in- troduce new colors in its model. D4 decisions are made using predictive coding. The predictor used is the same of JPEG-LS. Prediction residuals are coded using a method based on Golomb Coding.
Paul J. Aubeck Jr. has also developed a streaming approach for PWC [3]. Instead of making two complete image passes, the basic strategy of streaming PWC is to make two passes
through each image scanline. The first pass makes D1 decisions to establish rectilinear connectivity within the scanline and to the previous scanline. The second pass determines the color of each domain stripe by either propagating the color from the previous scanline or, failing that, by making decisions D2-D4.
Another development made in PWC was the introduction of a Skip-Innovation model. The basic idea is to skip over uniform areas entirely if possible and to partially skip them if not. This is made introducing another decision into the PWC coding model.