Using Next Gen Image Formats - WebP and AVIF cover image

Using Next Gen Image Formats - WebP and AVIF

Jeremy Nusser • January 21, 2023

Are you seeking the best image format to boost your site's performance? Then it would be best to consider using the WebP image format instead of JPG and PNG images.

Why use next-gen image formats like AVIF and WebP?

One essential aspect of optimizing website performance is leveraging fast-loading image formats. When it comes to speed, WebP and AVIF formats excel:

  • WebP images are typically 25%-34% smaller than PNG and JPG
  • AVIF can reduce image sizes even further
  • Significant impact on website loading speeds
  • Can decrease website size by up to 50% in some instances

Benefits of WebP and AVIF

1. Better Compression Technology

  • Superior image quality at smaller file sizes
  • No need to sacrifice quality for size

2. Easy Integration

  • Works with existing platforms like WordPress, Magento, or Shopify
  • Plugins available for easy conversion (e.g., Short Pixel Optimizer for WordPress)

3. Cross-Browser Support

  • Supported by Chrome, Firefox, and Opera
  • Note: Microsoft Edge doesn't support AVIF yet

WebP vs AVIF Comparison

File Sizes (600x600 pixel image)

Format Size
JPG 32 KB
PNG 96 KB
WebP 13 KB
AVIF 12 KB

AVIF is 2.66 times smaller than JPG and 8 times smaller than PNG.

Quality

Both formats offer high quality at smaller file sizes compared to traditional formats.

Implementing WebP and AVIF

Use progressive enhancement:

<picture>
    <source srcset="images/example.avif" type="image/avif">
    <source srcset="images/example.webp" type="image/webp">
    <img src="img/example.jpg" alt="Example">
</picture>

Key Advantages

WebP

  • 25-34% smaller than JPEG
  • Up to 40% smaller than PNG
  • Faster load times

AVIF

  • Even smaller file sizes
  • Excellent for lossless compression

Conclusion

Both WebP and AVIF offer significant improvements over traditional formats: - Smaller file sizes - Faster loading times - Maintained image quality

Recommendation: Use AVIF with WebP as a fallback for optimal performance and compatibility.

Useful Links