1. A method of compressing digital image data comprising: selecting an entropy code for encoding a line of pixels in the digital image data, wherein the entropy code is selected from a plurality of variable length entropy codes; using spatial prediction to compute a pixel predictor and a pixel residual for a pixel in the line of pixels; and selectively encoding the pixel residual using one of the entropy code or run mode encoding.