lossless compression of fragmented image data is disclosed . in some embodiments , a stream of information comprising data elements having statistical characteristics is received . an encoded output is produced by an encoder comprising a data compressor that implements a variable length code that is adapted to the statistical characteristics of the data elements . the output and information from which the variable length code can be derived are stored .