First for mac news, reviews and know-how
SEARCH FOR:   Advanced Search
Guest  Level 00    Register Log in

Features

The big squeeze

20060412 [MacUser]
Run-length encoding

One of the simplest ways to compress and encode data is to represent runs of data as a single value. Let's say we want you to store this image of a Mac Plus' Apple menu. If we gave you a 19 x 19 grid, we could call out across an office, telling you whether to colour each pixel white (W) or black (B) - see below left. Or we could tell you how many white pixels there are, running from top left to bottom right, before hitting a black pixel (67). Then there are two black pixels and another run of 16 white pixels. And so on and so forth. Using this compression technique, exactly the same image can be described across an office as shown in the figure below right: 

   1 Compression technique