How to Use Modern Image Formats – AVIF & WebP

September 7, 2022
How to Use Modern Image Formats – AVIF & WebP

Images continue to be an important resource on web pages, and they’re usually one of the most significant pieces of content on the page. As a result, site users have come to expect high-quality images on the sites they visit. However, images need to be delivered in a way that’s both effective and efficient. 

Have you taken a look at your site’s Largest Contentful Paint rating? If not, then now’s a great time to check it out. The reason to check your site’s LCP is that performance is becoming one of the top metrics used by Google to rank sites in their search engine. For this reason, image optimisation has never been more important than now. 

Why are Modern Image Formats Important? 

There is a wide range of image formats available to render images on a website. The main difference between these image formats is the image codec used to decode and encode each image. 

An image codec is an algorithm used to compress and encode images to a certain file type and decode them to display on the screen. 

How Do You Choose the Right Image Format? 

You can use these factors to determine which image format is best for your site: 

Quality: compression should not lead to loss of image data but should be lossless. 

Compression: the efficiency of a codec is typically measured by how much compression it is able to achieve. Compression achieved is essential because the higher the compression, the smaller the file size. The result is a lower amount of data needed to transfer the image on the network. Plus, a smaller file size can improve the LCP metric on the page, making the page load faster. 

Encode & decode speeds: the algorithms used for compression can be complex and need more processing power to encode and decode images. Matters can become even more complicated depending on whether the encoding is done ahead of time or on-demand. A complex decoding process can also slow rendering of the images. 

In addition, specific uses may require image formats that are able to support other features, such as: 

Animation support: may be needed for some images (such as GIF). However, it’s usually best to replace these with video. 

Alpha transparency: is the ability to create images that have different opacity levels through the use of the alpha channel (such as with PNG images)

Software support: an image format should perform well with CDNs, browsers, and other image manipulation tools. If not, then the software is useless. 

HDR: an image format should support high dynamic range (HDR) imaging and a wide colour gamut. 

Progressive decoding: allows images to load gradually, providing users with a preview of the image before it’s completely downloaded. 

Depth maps: make it easy to apply effects to the foreground or background of an image. 

Overlapping layers: an image format should allow for this feature, such as text overlays and more. 

What About JPEG & PNG? 

JPEG has been around forever and has been one of the most supported image formats for over 25 years. The older JPEG encoders usually result in weak compression; however, the newer JPEG encoders such as MozJPEG improve compression. Yet, they don’t entirely result in optimal images. Plus, JPEG is a lossy compression format (it reduces the quality of the image). 

Decoding speeds are great for JPEGs; however, the format just doesn’t have the features required for modern, beautiful websites. Plus, JPEG does not support transparency, animation, depth maps, or overlays. 

JPEG is best for photos; however, PNG is best for still images. PNG is a lossless format (no loss of image quality), which supports alpha transparency. However, the compression for photos is very low. 

This is where the modern image formats come into play. The modern image formats are able to offer better compression and flexibility that supports the features outlined above. 

AVIF

AVIF (also referred to as AV1) is an image format that’s an open-source image format used to store still and animated images. AVIF was released with the aim of developing a new open-source video coding format that’s cutting edge and royalty-free. 

Benefits of Using AVIF

Here are some of the benefits of the AVIF image format: 

The format is able to support efficient lossy and lossless compression, resulting in high-quality images after compression. This format is much more efficient at compression than the JPEG and other image formats. The images with AVIF are about ten times smaller than with JPEG, and the file size can be up to 50% smaller than a JPEG image. 

In addition, AVIF offers these benefits: 

WebP

WebP was created by Google back in 2011, designed to be an image format to help speed up the web. Since then, WebP has become accepted and used widely, as it has the ability to compress images to lower file sizes compared to PNG & JPEG. 

What’s more, WebP offers both lossy and lossless compression at a visual quality that’s considered acceptable, and it supports alpha-channel transparency, as well as animation. 

Lossy WebP compression is based on the VP8 video codec, which uses predictive encoding. It does this by using values in neighbouring blocks of pixels to predict the value in a specific block. And then it encodes only the difference. 

Lossless WeP images, on the other hand, are created by applying multiple transformation techniques to images in order to compress them. 

The Benefits of WebP

WebP lossless images tend to be about 26% smaller than PNS. What’s more, WebP lossy images are 25% to 34% smaller than JPEG images. 

WebP supports animation, making these images great replacements for GIF images. 

WebP also offers these additional benefits: 

Summing It Up

If you’re looking to speed up your web pages, consider using the more modern image file formats. They offer better image quality with compression and more to make your website faster. Optimising site images with AVIF & WebP image formats are also a sure way to rank higher in the search engines!

hello@pragmaticdigital.co.uk

Compass House, East Street,
Leeds, LS9 8EE

0113 534 9949

Toggle theme

© 2025 Pragmatic Digital Ltd. All rights reserved.
View our Cookie Policy and Privacy Policy.