Gzip to bmp images on the fly

gzipimages

I havent decided on a technology yet but i wanted to ask. BMP images are large, i compressed a 3mb image to 50k. Browsers can decode gzip text, so would it be possible to gzip bmp on my server and have the user request mysite.com/images/test.bmp and have it decompress my gzip bmp on the other side so the user doesnt notice a difference?

Best Answer

If possible, use PNG as image format. It's the defacto standard for lossless image compression and will probably surpass the compression level achieved by merely gziping bitmaps.

If you need to use BMP because of dependencies from legacy systems, you can try using the output compression methods available in your webserver, e.g. see mod_deflate for Apache. Wireshark can be especially helpful in testing/debugging such setups.