adding method to compress bitmaps