Nikunj, I'd hate to have to implement this from scratch. But assuming you have the Wavelet Toolbox, please check our really nice demos on that Toolbox on Wavelet image compression. If you don't have that Toolbox, you can see the demos online...starting here:
http://www.mathworks.com/products/wavelet/demos.html
Then run out and buy yourself a copy that Toolbox rather than reinvent the wheel! :)
Brett