Lossless compression on image