Previous Next
76
CHAPTER 3 Syntax
TABLE 3.8 Predictor values
VALUE MEANING
1 No prediction (the default value)
2 TIFF Predictor 2
10 PNG prediction (on encoding, PNG None on all rows)
11 PNG prediction (on encoding, PNG Sub on all rows)
12 PNG prediction (on encoding, PNG Up on all rows)
13 PNG prediction (on encoding, PNG Average on all rows)
14 PNG prediction (on encoding, PNG Paeth on all rows)
15 PNG prediction (on encoding, PNG optimum)
The two groups of predictor functions have some commonalities. Both make the
following assumptions:
• Data is presented in order, from the top row to the bottom row and, within a
row, from left to right.
• A row occupies a whole number of bytes, rounded up if necessary.
• Samples and their components are packed into bytes from high-order to low-
order bits.
• All color components of samples outside the image (which are necessary for
predictions near the boundaries) are 0.
The predictor function groups also differ in significant ways:
• The postprediction data for each PNG-predicted row begins with an explicit
algorithm tag; therefore, different rows can be predicted with different algo-
rithms to improve compression. TIFF Predictor 2 has no such identifier; the
same algorithm applies to all rows.
• The TIFF function group predicts each color component from the prior in-
stance of that component, taking into account the number of bits per com-
ponent and components per sample. In contrast, the PNG function group
predicts each byte of data as a function of the corresponding byte of one or
Previous Next