INCREMENTAL COMPRESSION ALGORITHM by Jeff Connelly One day I was looking up at the sky. I noticed it is darker at the top and lighter at the sides, it blends. How could a image of this type be compressed efficantly? The answer is incremenal compression, as you may have guessed because of this document's title. As it's name implys, incremental compression compresses data that starts at one value and is incresed by a value up to yet another value. For example, 00 01 02 03 04 05 ... FA FB FC FD FE FF (256 bytes) Would compress good. But what does this have to do with the sky image? The sky is light blue at the bottom and gets darker as it goes up. A version of incremental compression could compress images like the sky one. The algorithm is simple, here is an example of manually encoding it: * Input data is: 01 02 03 * Read a byte: 01 * Subtract this byte, 01, from previous byte, 00 first time: 01 * Is the value above same as previous difference, 00? False. * Read another byte: 02 * Subtract this byte from previous byte, 01, result is: 01 * Is previous difference, 01, same as this, 01? True. * Increment repeated count, 0, now 1. * Read byte: 03 * Subtract from previous byte: 01 * Difference is same as last, both are 01 * Increment repeated count, 1, becomes 2. * End of data. * Write beginning byte, 01; increment value, 01; and end byte, 03. * Output: 01 01 03 * Note that minimum output size, besides zero, is three. Bytes from 00 to FF add 1 (00, 01, 03, ... FF) compressed would be: 00 01 FF That is three bytes! Ratio of 3/256 or 85.5% percent!