Vertical Differencing and Averaging
Since images are 2-dimensional, we have to do this averaging and differencing in two dimensions as well. We can first do it within every row, transforming our 256x256 image into two arrays (one of averages, one of differences) of 256x128 entries each; for each of these we can then do the same vertically, so that in the end we have four arrays of 128x128. Here is a simple example:
After averaging and differencing within every row:
After averaging and differencing in two directions:
In these four little arrays, the top left one corresponds to averaging in both directions; this array typically has sizeable entries for all pixels. The other three arrays typically have most of their entries very small, and can thus be highly compressed.
Try to perform averaging and differencing for the following example:
Input the answer and press tab or click in another window. After averaging and differencing within every row:
Now perform averaging and differencing within every column: