The PCIF algorithm: filtering phase
In the filtering phase the PCIF algorithm does not reduce the dimension of the image to compress but it transforms it values in order to obtain a more compressible set of data. What we want to obtain after the filtering phase are a lot of values close to zero and a decreasing number of higher values. The filtering phase is divided in three subphases: standard filtering, color filtering and remapping.
This filtering phase, especially in its first part, is quite similar to that used in PNG but it operates in a much more efficient way. First of all, an ordering is defined on the points of the image. At this point the algorithm proceeds from the last point of this sequence to the first. For every sample an estimate on its value is made, using as parameters of the estimation function only the previous points. Every value is replaced with its difference from the prevision, modulo 256 to mantain the range of the values equal. In this way, during the decompression phase the algorithm will start from the first point and proceed to the last and at every step it will be able to reconstruct all of the original values of the image. Below some more details about the three subphases of filtering, detailed informations can be found at the relative sections.
- Standard filtering: In this subphase, the estimation done is based on smoothness assumptions: in an image usually there are a limited number of edges or sudden color changes, while most part of the values is quite similar to the ones close to them. Tipical standard filtering functions used for an estimate give as an output adjacent values or an average of some of them. This phase is described in more detail in the standard filtering section
- Color filtering: This subphase computes an estimate for the already filtered value in the image using samples that represent the different colors of the same pixel. This estimation is justified by the fact that usually variations in the image (represented by the values after the standard filtering phase) usually reflect themselves in more than one color plane. Applying a second filtering phase to decorrelate colors after a standard filtering phase is one of the innovative techniques of the PCIF algorithm. In this way the obtained results are similar to those of a locally optimized color transform, and thanks to this double step the color filtering phase takes advantage of the information already obtained in the standard filtering phase. Read more about the color filtering in the dedicated section.
- Remapping: To be sure that the distribution of the values is exactly the desired one, every possible value is mapped into another. This step is described further in the remapping section.
To show the effectivness of filtering below there is a table that shows how the first-order enthropy of the Lenna image decreases in the various steps. In this particular case color filtering gives less advantage than usual, as we can generally obtain a major gain for other images.
Reduction of the first order enthropy of the Lenna image through filtering | |||
Color component | Initial enthropy | Enthropy after filtering | Enthropy after color filtering |
Blue | 6.96 | 4.88 | 4.88 |
Green | 7.56 | 4.65 | 4.43 |
Red | 7.25 | 4.13 | 4.07 |
A complete graphical example of filtering applied to the Lena image, with a numerical example in an 8x8 zone, can be found in the subsection a filtering example.