A method for compressing and decompression digital image data. When
compressing, the method begins by choosing a reference row. The relative
data between the reference row and the current row is compared to search
for the differential data set. The largest matching data set of the
differential data set is searched starting from the starting position of
the last differential data set. According to the matching conditions, the
data type of the to-be-compressed data is first verified, then the
to-be-compressed data set type and its relative referencing value are
verified. Finally, the relative coding process is started. This process
has a higher compression ratio and decompression speed, and increases the
compression speed dramatically.