In image compression using transforms, how to deal with the transformed coefficients as they are not integers? I am new to the field of image compression. While going through various texts, I read about how transforming the image to another domain using, for example, the wavelet transform, or the DCT, makes it suitable for lossy compression.

I have been trying to play around with wavelet transforms on a sample bmp in MATLAB. Using the MATLAB library function, I created transform coefficients using Daubechies wavelets. 

Now a given pixel when read from bmp is in uint8 format, i.e., it uses up 1 byte of memory. This is because in most image formats the range of values a pixel can take is from 0 to 255. After wavelet transformation however, one gets double precision floating point for each element of the transformed matrix. This would typically consume about 4 bytes for each element.

My goal was to try out some very basic compression using quantization and entropy coding of quantized elements. Quantizing the low magnitude values of the transformed elements to zero does give good compression. But trouble is I have to still use double precision floating point. The moment I convert all the wavelet coefficients to some integer format, the reconstructed image becomes very poor in quality as compared to the original.

In standard compression techniques, how are the transformed coefficients handled, given that they are not integer in format? Each transformed coefficient, due to its double precision nature, takes up more bytes than the original. Can you point out resources where this issue has been explained?
Oftentimes some rounding occurs in storing the coefficients. This is why many image compression algorithms are lossy, i.e. they lose information when converting the floating point coefficients to integer format. The process of rounding is called quantization. See this wikipedia article for an example. 

http://en.wikipedia.org/wiki/JPEG#Quantization