WebP or AVIF: how to decide per image
Not every image needs the same format. This post walks through a simple decision process for hero photos, product shots, icons and screenshots.
Image performance, explained plainly
On a typical page, images are commonly cited as making up around sixty percent of the total weight, more than scripts, fonts and styles combined. This blog covers what that means in practice: which formats actually help, how compression works without visible loss, and how alt text and lazy loading touch both accessibility and search at the same time.
Why this matters
Developers spend a lot of attention on JavaScript bundles and font loading, and both matter. But on most content-heavy sites, images are the largest single category of bytes sent to a visitor's browser, and they are usually the easiest category to reduce without touching a line of code.
Typical share of page weight taken up by images
Often cited around 60%, varying by site and content type
This figure moves around depending on the industry. A text-heavy news site will differ from a photography portfolio or an online store with hundreds of product shots. What stays consistent is the pattern: unoptimized images are the first place to look when a page feels slow, and they respond well to fairly simple fixes.
Mostly because it happens quietly. A content editor uploads a photo straight from a phone or a stock library, the CMS displays it at the right visual size, and nothing looks wrong on screen. The file itself can still be several megabytes larger than it needs to be, and that extra weight is invisible until you check page speed tools or watch the network tab in a browser's developer console.
Formats
Both are image formats designed to store the same visual information in fewer bytes than older formats like JPEG and PNG. Neither is exotic anymore. The question is less "should I use them" and more "does my CMS already support them, and how do I check."
As a starting point: use WebP as a safe general default because support is close to universal. Reach for AVIF on large photographic hero images where the extra byte savings matter most, and keep an eye on encoding time if your CMS processes images on upload rather than in the background. For small icons or simple graphics, SVG is often a better fit than either format.
Accessibility and search
Alt text was built for accessibility first. Screen reader software reads it aloud in place of an image, so a person who cannot see the picture still knows what it shows. That is the primary purpose, and it should stay the priority when writing it.
Search engines read the same attribute because they cannot interpret pixels directly. A clear, accurate description helps an image show up in image search results and gives a search engine additional context about the surrounding content. Writing genuinely descriptive alt text serves both audiences without any conflict between them.
Loading behavior
Lazy loading tells the browser to hold off downloading an image until it is close to entering the viewport. Applied correctly, it can visibly change several of the metrics Google groups under Core Web Vitals, without touching the images themselves.
In practice: add the native loading="lazy" attribute to images below the fold, leave it off (or set to eager) for anything visible on first paint, and always include width and height attributes. The screenshot walkthroughs show where to find this setting in common CMS platforms.
Free tools
Compression removes data a viewer is unlikely to notice missing. Pushed too far, it introduces visible artifacts. The goal is finding the setting where file size drops sharply and the picture still looks the same to a normal viewer at normal screen sizes.
Around 75 to 85 out of 100 is where most photographs stop showing visible differences to the eye, while file size keeps dropping below that range.
Latest posts
Not every image needs the same format. This post walks through a simple decision process for hero photos, product shots, icons and screenshots.
A short guide to describing images clearly for screen reader users, with notes on where search engines quietly benefit from the same habit.
Lazy loading the wrong image can quietly make your Largest Contentful Paint worse. Here is how to tell which images should stay eager.
Screenshot-based, step by step, covering compression, format conversion, alt text and lazy loading in common CMS platforms.
Open the walkthroughsThe honest answer is that both formats can coexist on the same site, applied to different kinds of images. WebP has near-universal browser support at this point and encodes quickly, which makes it a reasonable default for a CMS that processes images automatically on upload.
AVIF tends to produce smaller files for photographic content, particularly images with a lot of fine detail or gradients, such as landscape photography or portraits. The trade-off is longer encoding time and slightly less consistent support across CMS plugins and older browser versions, which is usually handled with a fallback image.
For icons, logos and simple flat-color graphics, neither format is usually the right tool. SVG stays smaller and stays sharp at any size, since it is not a pixel-based format at all.
A practical approach: convert your largest hero and banner images to AVIF with a WebP or JPEG fallback, leave smaller inline photos as WebP, and keep flat graphics as SVG or PNG where transparency is required and the image is simple. Test a handful of images first rather than converting an entire media library at once.
Alt text exists so a screen reader can describe an image to someone who cannot see it. That single purpose should guide every description you write. A good test: read the alt text aloud without looking at the image, and ask whether it would make sense to someone hearing only that sentence.
Avoid starting with "image of" or "photo of", since screen readers already announce that an image is present before reading the alt text. Instead, describe what matters in the picture: who or what is shown, what they are doing, and any detail relevant to the surrounding content.
For decorative images that add nothing informational, such as a repeated background flourish, an empty alt attribute (alt="") is the correct choice. This tells assistive technology to skip the image entirely rather than reading a meaningless description.
Search engines use the same attribute to understand what an image depicts, since they cannot interpret pixels directly. Writing accurate, specific alt text naturally supports image search visibility as a side effect of writing it properly for accessibility in the first place. There is no separate "SEO version" of alt text worth writing.
Lazy loading is a genuinely useful default for images that appear below the fold. It defers their download until the browser expects the user to scroll near them, saving bandwidth and speeding up everything above.
The mistake shows up when lazy loading is applied globally, including to the image that is visible the moment a page loads, often a hero banner or featured photo. That image is frequently the Largest Contentful Paint element Google measures. Delaying its download to wait for a lazy-load trigger can push LCP later, sometimes by a noticeable amount.
The fix is straightforward: identify whichever image sits above the fold or forms the main visual anchor of the page, and either remove the lazy loading attribute from it or set it explicitly to loading="eager". Everything further down the page can stay lazy loaded without any downside.
Many CMS platforms apply lazy loading automatically to every image tag through a plugin or theme setting. Checking that setting and excluding hero images is usually a five-minute fix with a visible effect on a Core Web Vitals report.