1. A compression method comprising: receiving raster data including a two dimensional (2D) array of pixels, wherein each pixel is associated with a data value; receiving a first user defined parameter defining a maximum error allowable per pixel; subdividing the 2D array of pixels into a plurality of blocks, wherein each block includes a plurality of pixels; determining minimum and maximum data values of the plurality of pixels within each block; determining a number of bytes needed to encode each block based on the maximum error allowable per pixel and the minimum and maximum data values for the particular block; and encoding each block within the determined number of bytes such that, when decoded, the 2D array of pixels will not deviate from its pre-encoded data values by more than the maximum allowable error per pixel.