Next-generation image compression (WebP & AVIF) in website design: Small details, big differences

In the structure of a typical B2B website (such as company profile, construction or project images), images usually account for 60-80% of the total download capacity. If a business is downloading 3MB JPG or 5MB PNG files directly from the camera to the content management system (CMS), it is a speed disaster (Page Speed) and a huge minus point in the eyes of Google's SEO algorithms.

To solve the performance problem without sacrificing image sharpness, website design experts have officially said goodbye to JPG and PNG to switch to such compression standards. New system: WebP and AVIF.

1. The Superiority of WebP and AVIF Formats

  • WebP: Developed by Google itself, WebP provides superior image compression capabilities. A landscape banner photo exported to WebP format can reduce the size by 30% to 50% compared to JPG format of the same quality, and also supports the transparent background feature (Transparency), which was the exclusive strength of PNG in the past.
  • AVIF: This is considered the "King of web image formats" in the next decade. Developed by the Alliance for Open Media, AVIF uses a video compression algorithm that reduces image size by 20-30% compared to WebP, while preserving the brilliance of colors and extremely excellent dynamic range (HDR).

2. Implementing Automation in the Website Design ProcessBusinesses do not need (and should not) force Marketing staff to open Photoshop to export AVIF files for each photo. Professional website design thinking will set up automation processes right at the server-side: When an employee uploads an original JPG image file, the CMS system will implicitly activate image processing libraries (such as ImageMagick or Sharp). It automatically copies the original photo and converts it into 3 different formats: AVIF, WebP and JPG.

3. Building a Picture ElementTo ensure the website is always smooth on all types of old and new browsers, website designers will use the advanced HTML tag <picture>. The user's browser (Google Chrome, Safari) when reading this tag will have an implicit "conversation" with the server: "If you support AVIF, I will send the lightest AVIF file. If not, I will try sending the WebP file. If your browser is too old, I will display the original JPG file".

This smart image processing mechanism acts as a flexible shock absorber. It ensures B2B partners using new phones have a lightning-fast page loading experience, while customers using older generation office computer systems can still view images fully, without display errors.