Portal deploys can now convert your site's images to WebP or AVIF
TL;DR: Deployment targets in the portal now have Image Conversion controls. Turn it on, and each deploy first converts your JPEG and PNG images to WebP or AVIF in the background, then deploys them and shows a report.
Image Conversion has been a part of ee-cdn-cli and ee-builder for some time now, but not from the portal.
If you deploy from the portal, you no longer need a separate tool to convert your site’s images. Deployment targets now have an Image Conversion section. Turn it on, and each deploy converts your JPEG and PNG images to WebP or AVIF and rewrites every reference to them in your pages, the same way ee-cdn-cli does. Targets with the section off deploy exactly as before.
Options
- Image format: WebP, which is preselected, or AVIF.
- Quality: a whole number from 1 to 100. Leave it empty to use the format’s default, shown in the field.
- PNG images: Lossless or Lossy.
- Other hosts: other hosts your site is served from, one per line or separated by commas, so references that use those hosts’ full addresses are rewritten too. Add a port if one is needed, but no
https://or path. - The form wins over
ee.jsonc. The format and PNG choice you set in the form are always used, even if your site’see.jsoncsays otherwise. Quality and other hosts are used only when you fill them in.
How a deploy runs
- Your images are converted first, in the background. The target shows each stage while it runs.
- Then the converted files are deployed. The panel shows the report’s totals, and why any images were left alone.
- Your uploaded files are never changed. Only what is deployed is converted.
- Your Level 1 key never leaves the portal. Images are converted before your site is encrypted, and the key is shown only in the deploy’s result, as before.
- Converted files that aren’t deployed within 30 minutes are deleted. If that happens, or a conversion is interrupted, nothing is deployed and you’re asked to deploy again.
Limits
- The portal doesn’t scale down wide images. That is available only with
ee-cdn-cli’s--image-max-width. (coming soon) - One conversion per target at a time. Deploying again while one runs is refused with a message.
- Changing settings mid-conversion discards it. If you change the target’s image settings or its domain, in the form or in
ee.jsonc, while a conversion runs, the converted files aren’t deployed, and you’re asked to deploy again. - Some images are left alone, as with
ee-cdn-cli: GIF and SVG files, animated images, CMYK images, images with a colour profile other than sRGB, 16-bit images and images over 40 megapixels.
What you need to do
Nothing, unless you want to use it. To try it, edit a deployment target, turn on Image Conversion, choose a format and deploy.