RLE Made Easy

See all articles from Update July 1992
Author(s): W.J.Pedersen
Publication: Update Magazine
Pub Details: Update July 1992
Date: July 1992
Pages: 38

Run Length Encoding is one way to send pictures over the telephone lines. Picture data replaces character data. The parity bit is ignored, as are ASCII control codes except 07h.

A zebra picture with one scan line expanded into a bar of INK and PAPER pixel runs, with the run lengths marked
A zebra picture with one scan line expanded into a bar of INK and PAPER pixel runs, with the run lengths marked

The divider bar shows where there are too many PAPER pixels to fit in a byte. An INK byte for 0 pixels is inserted. Any number of pixels can be accommodated. In this way, bytes alternate between INK and PAPER. 32 is added to pixel count so that 0 to 95 pixels can be stuffed in each byte. The list of bytes is ended by 07h. It begins after a header ending in “GH”. Headers can be up to 101 bytes.

Picture data above is:…/127/32/44/33/34 37/33/39/34/34/55/45/34/38/33/33/37/33/33 35/47/51/35/35/33/36/34/39/34/38/34/37/35 36/38/33/34/39/33/36/33/39/37/33/42/…

RLE works best with line drawings. It often yields files bigger than SCREEN$, so file compression is not to be expected.

BBS Uploading and downloading is its forte, at which it excels.