Lossless compression of images with specific characteristics