Losslessly compress images