This is a paid option that is now available in closed beta version. To send a service request, contact technical support. If possible, we will provide access to the feature.
What is WebP
What it is used for
Compare: the same picture in WebP, PNG and JPG
What images can be converted to WebP
How compression works
When image cannot be compressed
How to configure “WebP compression” in your control panel
What is WebP
WebP is an image format with an advanced compression algorithm. By converting an image from PNG or JPG to WebP, you reduce its size by an average of 25-35% without any visible loss of quality.
To compress images, WebP uses a RIFF container. The compression algorithm is based on the intra-frame coding of the VP8 video format.
What it is used for
WebP images give you a smaller web page and shorter load time. The more images a website has, the greater the difference in download time will be.
Compare: the same picture in PNG, JPG, and WebP
Below is a painting by Wassily Kandinsky in PNG, JPG, and WebP formats. Sharpness and color rendering are the same, but the WebP file’s size is smaller.
PNG (1860 КB) / JPG (169 КB) / WebP (136 КB)
What images can be converted to WebP
Our CDN can compress both JPG and PNG images, i.e., image/jpg and image/png mime-type files.
How compression works
Requests for PNG and JPG images are proxied through our converter service. It takes an original image from your server, converts it to WebP, saves it in CDN cache and sends it to an end-user. After converting, an image does not change its URL or extension. An image header contains the following conversion details:
- x-gcdn-img-server — server that has converted the image,
- x-gcdn-origin-download-time — time in milliseconds that was taken to download your image from origin,
- x-gcdn-origin-size — original image size in bytes,
- x-gcdn-processing-time — time in milliseconds that was taken to convert the image,
- x-gcdn-saved-bytes — difference in bytes between the sizes of the source image and the WebP image.
When image cannot be compressed
If an image cannot be converted to WebP, an end-user will receive the original image downloaded into the CDN cache from the origin. Here are the cases when the conversion is not possible:
- Quality of an original image is lower than the target quality you specified in the settings.
- An original image has been compressed in gzip.
If a user's browser does not support WebP (older browsers don't support this format), the user will also receive an original image. CDN determines whether to send a converted image or original one according to a client's Accept header: the value image/webp indicates support for WebP.
How to configure “WebP compression” in your control panel
When technical support activates the “WebP compression” feature for you, it will appear in your control panel.
Turn on the toggle switch: the green one means the compression is enabled. You can set the following conversion options:
- quality settings for JPG — required quality in PSNR of JPG images after conversion to WebP. If the quality of an original image is below the specified one, CDN sends a user the original image. If quality is higher, CDN converts the image to WebP in the specified quality and sends it to the user.
- quality settings for PNG — required quality in PSNR of PNG images after conversion to WebP. If the quality of an original image is below the specified one, CDN sends a user the original image. If quality is higher, CDN converts the image to WebP in the specified quality and sends it to the user.
- enable lossless for PNG — this enables lossless compression of PNG images to WebP. If the box is checked, then “Quality Settings for PNG” will not work.