The embodiments of the invention include a system and method for losslessly encoding
and compressing a data stream. The data stream may be an image, text or combination
of the two. The data stream may be received from a computer application or peripheral
device. The encoding compresses the data stream by comparing consecutive values
of the data stream and encoding the data based on the difference between consecutive
data values.