Loseless and lossy techniques for data compression