In the following, xi,j = xm stands for the color value of the pixel currently in position (i,j) = m in the pixels original image, and is the color value of the ``predicted'' (reconstructed) pixel of the reconstructed image. As seen in  and accordingly to Fig. 2, the configuration of the 2-D predictor is as following:
where xm= xi,j, , , and
In the above, em stands for the error value between the original and the reconstructed pixels:
Finally, is the quantized value of em, as described in
 from which Table 1 is drawn.
Input: xi,j = xm, , , and (see Fig. 2).
Method: We compute a first , then em and . Eventually, we update the value of .
begin Compute accordingly to Eq. 2 Clip to the range [0,255] Compute Compute Upgrade by computing := Clip to the range [0,255] end
In fact, we add an offset of 128 to , making all of the error values positive (for an 8-bit original) so that they can be printed on a output device. The error image for a perfectly reconstructed image is thus uniform gray field with a code value of 128.
The DPCM algorithm is summarized in Figure 3. We
observe that it applies to every pixel of the image. That leads to the
Input: xi,j = xm, for all and .
Output: , for all and .
Method: We use PREDICTION to compute for each pixel.
begin Initialize and for all and j=0. for j=1 to N-1 do for i=0 to N-1 do Call PREDICTION on xi,j = xm, , , and (see Fig. 2). doend doend end
From Figure 3 one concludes that the prediction
(reconstructed pixel) for the transmitter is exactly the same as the
one used by the receiver. They both need, and only need, the quantized
difference . The transmitter puts this difference in a file, whereas
the receiver reads this difference from the file.
Finally, , which is the quantized difference for each pixel, and the whole picture (formed with these quantized differences) is compressed with Huffman code.