Virtually lossless compression of astrophysical images