As described in the original announcement from Cloudflare, the main image formats used on the web haven't changed much since the early days. Apart from the SVG vector format, websites are still serving images as GIF, JPEG and PNG.
WebP is a newer image format for the web, proposed by Google. It takes advantage of progress in image compression techniques since formats such as JPEG and PNG were designed. It is often able to compress the images into a significantly smaller amount of data than the older formats.
WebP is versatile and able to replace the three main raster image formats used on the web today:
- WebP can do lossy compression, so it can be used instead of JPEG for photographic and photo-like images.
- WebP can do lossless compression, and supports an alpha channel meaning images can have transparent regions. So it can be used instead of PNG, such as for images with sharp transitions that should be reproduced exactly (e.g. line art and graphic design elements).
- WebP images can be animated, so it can be used as a replacement for animated GIF images.
Currently the main browser that supports WebP is Google's Chrome (both on desktop and mobile devices). See the WebP page on caniuse.com for more details.
Cloudflare customers with a Pro, Business and Enterprise plan can enable the automatic creation of WebP images by ticking the WebP checkbox found on the "Speed" page of the dashboard. When this is enabled, Polish will optimize images but convert the image to WebP, if WebP can shrink the image data more than the original format. These WebP images are only returned to web browsers that indicate they support WebP (e.g., Google Chrome).