Compress an image file.