Cloudflare Polish compressing only minimally

I’ve enabled Polish to compress images on my website but the compression is only minimal. This image for example weighs 382kB with Polish enabled with Lossy compression. The original size is 395 kb, so, the compression is only about 4%. On I can compress this image further 60% without losing significant quality.
The performance I’m seeing with Polish, is it to be expected or does it seem wrong?

Polish should provide you with better results, do you have the original image?

Yes, not sure if posting it here will degrade the original image. But this image, the Cloudflare size after Polish is 382kB and according to the Polish header, the original file size is 395kb. Header cf-polished: origSize=395303, status=vary_header_present

Photographic images should always be saved in JPEG or some newer image compression format, not PNG. PNG is for things like icons and line-art work. The image you’re linking to is a PNG file with a photographic-quality image. Convert it to JPEG (at the origin) and Polish will compress it further if possible. Polish assumes PNG to be lossless, and therefore it will only strip the metadata out of the file, hence the small reduction in size.

These modes are respected when JPEG images are converted to WebP. In lossless mode, the conversion is done in a way that preserves the image as faithfully as possible (due to the nature of the conversion, the resulting WebP might not be exactly identical, but there are unlikely to be any visible differences). In lossy mode, the conversion sacrifices a little quality in order to shrink the image data further, but as before, there should not be a significant visible effect.

These modes do not affect PNGs and GIFs, as these are lossless formats and so Polish will preserve images in those formats exactly.


Ah of course. Converting those images to JPEG seems to have fixed the problem. Thank you for the hint!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.