We'll do even simpler compression: After computing the wavelet transform of the image, quantize its coefficients to b bits per coefficient. Reasonable values of b will be between 8 and 16.
To do this, first find the largest coefficient in the wavelet transform -- that will be the coefficient of the broadest scaling function, phiphi(x,y). Call this value cmax. Scale all coefficients so that the range [-cmax,cmax] is mapped to a signed, b-bit integer, i.e. a number between -2^(b-1) and 2^(b-1), quantize these values to integers using floor() to create a new coefficient array.
I do ask you to estimate the compression achievable using a very simple sparse matrix compression scheme: we could use one bit per coefficient to record whether its value is zero or not, and then use b additional bits per coefficient for the nonzero values. Call this number of bits the "compressed image size". Now calculate (compression factor) = (original image size)/(compressed image size) where original image size is pessimistically taken to be 8*npixels bits (note that JPEG and other picture file formats do much better than 8 bits per pixel, typically).
where "cf" means compression factor. Run each picture at least two times with results including one run where the errors of compression are invisible, and another where they're barely visible.picture-name npixels b cf rel.err