A Simple Transform Encoding procedure maybe described by the following steps for a 2x2 block of monochrome pixels:

- 1.
- Take top left pixel as the base value for the block, pixel A.
- 2.
- Calculate three other transformed values by taking the difference between these (respective) pixels and pixel A, i.e. B-A, C-A, D-A.
- 3.
- Store the base pixel and the differences as the values of the transform.

and the inverse transform is:

The above transform scheme may be used to compress data by exploiting redundancy in the data:

Any Redundancy in the data has been transformed to values, *X*_{i}.
So We can compress the data by using fewer bits to represent the differences.
I.e if we use 8 bits per pixel then the 2x2 block uses 32 bits/
If we keep 8 bits for the base pixel, X0, and assign 4 bits for each difference then we only use 20 bits. Which is better than an average 5 bits/pixel

**Example**

Consider the following 4x4 image block:

120 | 130 |

125 | 120 |

then we get:

We can then compress these values by taking less bits to represent the data.

However for practical purposes such a simple scheme as outlined above is not sufficient for compression:

- It is
**Too Simple** - Needs to operate on larger blocks (typically 8x8 min)
- Calculation is also too simple and from above we see that simple encoding of differences for large values will result in loss of information -- v poor losses possible here 4 bits per pixel = values 0-15 unsigned, -7 - 7 signed so either quantise in multiples of 255/max value or massive overflow!!

However, More advance transform encoding techniques are very common (See JPEG/MPEG below). Frequncy Domain methods such as Fourier Transform and (more commonly) Discrete Cosine Transforms (DCT) compression techniques fall into this category. We no consider these methods in general and then specifically.