Helpful information ...
WebP images for the web: how the switch reduces load times
WebP Images for the Web: How Switching Cuts Loading Time
Yes, switching to WebP images for the web is a sensible move for most sites. The format reduces file size by roughly 25 to 35% at comparable visual quality, which directly speeds up page loading. The fastest way to do this is to re-export your images as WebP and serve them through a picture element or a CDN, with JPEG as a safety net for older browsers. AVIF offers even better compression, but requires a more deliberate workflow, so WebP remains a practical, widely supported choice.
In short:
- When converting images to WebP, you can expect savings of 25 to 35% at the same visual quality.
- Older browsers and clients — especially in email or on outdated devices — still need a JPEG or PNG fallback.
- For optimal results, use the picture element, put formats and attributes in the right order, and check the user's support via the Accept header.
- The biggest savings come from pre-encoding static images, while on-the-fly conversion via a CDN offers flexibility.
- When planning your format strategy, choose AVIF for static, pre-encoded images and WebP for dynamic content or on-the-fly loading.
Table of Contents
- What WebP is and which types of compression it supports
- Do you need a fallback for older browsers?
- How to convert images to WebP: tools and steps
- How to correctly serve WebP images on a page
- Quality settings and measuring the impact
- WebP or AVIF: how to choose the right format
- How Moxy-web rolls out WebP in client web projects
- Risk-free image overhaul: what Moxy-web does for you
- Sources
- Frequently asked questions
What WebP is and which types of compression it supports
WebP is an image format developed by Google that supports four different ways of handling images: lossy compression, lossless compression, an alpha channel for transparency, and animation. That combination is rare. JPEG doesn't support transparency, PNG doesn't support animation, and GIF is limited in color depth and inefficient at compression. WebP can therefore often replace all three older formats at once, depending on what the image contains.
In practice, this means:
- Photos and photorealistic images go through lossy compression, similar to JPEG, just with a smaller file.
- Logos, icons, and graphics with transparency go through lossless or alpha mode, replacing PNG.
- Short animations that would otherwise be GIFs can become animated WebP files at a significantly smaller size.
Benchmark measurements using the SSIM index show that the size savings are consistent regardless of image type, which makes WebP the default choice for most websites.
Do you need a fallback for older browsers?
Today, most modern browsers support WebP without issue, but that doesn't mean you can skip the fallback entirely. Problems still show up in older embedded WebView components in certain mobile apps, in email clients that often don't display images correctly, and on some older corporate devices, where browser updates roll out more slowly than on personal computers.
Where a fallback is essential:
- Email marketing and HTML emails, where clients frequently don't support WebP.
- Document portals and intranet systems used on older corporate devices.
- Any site that needs to work on devices that don't get regular browser updates.
Pro tip: Never send WebP images directly in email campaigns without a JPEG version behind them, since plenty of email clients will simply drop the image.
Three mechanisms provide the technical solution: the picture element, which lets the browser choose between formats; negotiation via the Accept header of the HTTP request; and CDN services that automatically serve the right format based on the device. Combining these three approaches covers almost every edge case.
How to convert images to WebP: tools and steps
Converting images to WebP is simple if you go about it the right way. Several tools are available: the official libwebp library with the cwebp command, the Sharp JavaScript library for automated workflows, the free Squoosh web tool for manual testing, ImageMagick for batch processing, and numerous online converters and CDN solutions that handle the conversion automatically at delivery time.
Recommended sequence of steps:
- Encode from the source file (RAW, PNG, or TIFF), never from an already-compressed JPEG, since double compression degrades quality.
- Check the result visually, ideally with an SSIM comparison between the original and the WebP export.
- Back up the original files before replacing them on the server.
- Automate the process by building the conversion into your build pipeline, a CI job, or configuring your CDN for on-demand conversion.
When deciding between pre-encoding and on-the-fly conversion, a simple rule applies: encode static images that rarely change in advance, and let a CDN convert dynamic content — such as user uploads — on the fly.
How to correctly serve WebP images on a page
Correct implementation isn't just a question of format, but also of order and attributes. The picture element lets the browser choose the best format it supports, without needing a JavaScript solution, and this is now the industry standard for format fallback.
The order of sources within a picture element isn't arbitrary. The browser uses the first format it understands, so AVIF must be listed before WebP, and WebP before JPEG. Getting the order wrong means the browser will always fall back to the worst, but most compatible, format.
Besides the right order, you also need:
- width and height attributes on every image, so the browser reserves space in advance and prevents content from shifting during loading (CLS).
- A srcset with multiple sizes of the same image, so a mobile device doesn't download the same large file as a desktop screen.
- Lazy loading for images below the fold, so they don't load until the user actually needs them.
Modern CDNs, such as Cloudflare or Fastly, often automatically convert the format based on the browser's Accept header, which simplifies the whole AVIF-plus-WebP architecture. It's also worth checking the storage and security implications, since the CDN ends up storing multiple versions of the same image.
Quality settings and measuring the impact
Default quality settings aren't arbitrary. For WebP, a reasonable trade-off between size and appearance is a quality of around 80, and for AVIF around 60, which serves as a good starting point for most photographic content. From there, adjust downward until the visual difference becomes noticeable, and upward only for images with a lot of detail, such as product photos in an online store.
Beyond quality settings, you can save additional space by stripping metadata. Removing EXIF and ICC data can save 10 to 30 kilobytes per image, which adds up quickly to a noticeable difference in total page weight on a page with fifty images.
Pro tip: Create at least three size variants of every image (for example, 400, 800, and 1600 pixels wide) and serve them via srcset, instead of sending every device the same large file.
Use lossless WebP only for sharp-edged graphics like logos or diagrams, where lossy compression would degrade text or lines. Check the impact of your optimization with Core Web Vitals, since images are, on average, the largest share of a page's transferred data, meaning any reduction in size directly improves the Largest Contentful Paint metric. You can find a detailed overview in this guide to Core Web Vitals for developers.

WebP or AVIF: how to choose the right format
Choose AVIF when you're building a static site with photos you can pre-encode, and when build time isn't a constraint for you. AVIF brings an additional 20 to 30% in savings over WebP, but encoding takes longer, and tool support still isn't equally mature everywhere.
Choose WebP for dynamic paths, where images are generated on the fly — for example, user profile pictures or products uploaded by merchants themselves. Here, encoding speed outweighs the smaller size savings.
The recommended architecture for 2026 is a combination: AVIF as the first choice with WebP as a safety net for static pages, and WebP alone for dynamic paths and real-time uploads. When deciding, also take into account:
- The cost of encoding, whether on the server or during the site build.
- Decoding performance on the user's end, since older devices decode AVIF more slowly.
- The age of the devices in your audience, since a mixed audience means a fallback isn't optional — it's necessary.
How Moxy-web rolls out WebP in client web projects
Image optimization starts with an audit, checking which images on the site are the biggest drag on loading. That's followed by a proposed solution tailored to the CMS and hosting, then the actual conversion and integration into the build process or CDN.
Because this is custom-built code, we can integrate WebP and AVIF directly into the site's architecture, without the constraints of pre-built platforms. After launch, we monitor Core Web Vitals and adjust quality settings as needed based on visitor behavior. If you're curious how this approach has played out on real projects, feel free to ask us for examples from our own work.
— Ziga
Risk-free image overhaul: what Moxy-web does for you
Image optimization is complex, so we offer the entire process from a single source: an audit of existing images, conversion to WebP and AVIF, CDN integration, and ongoing maintenance that tracks how the site performs after the changes.
Because the code is custom-built, without relying on pre-made platforms, the image optimization is tailored specifically to your site, not to a generic template. We take the same approach when building websites, online stores, and applications, where loading speed is built in from the start.
If you'd like to see how fast your site could load with optimized images, check out the offering on the Moxy-web homepage and ask about a free audit or a proposal for an overhaul. For more on why speed directly affects traffic and sales, see this article on why website speed is key to success.
Sources
- WebP study — Google Developers
- AVIF vs. WebP: 4 Key Differences and How to Choose — Cloudinary
- WebP vs AVIF in 2026: Which to Use for Your Website | DuneTools
Frequently asked questions
Does WebP reduce image quality compared to JPEG?
At the same file size, WebP typically retains better visual quality than JPEG, which is why it delivers 25 to 35% savings at comparable quality.
Do I need to convert every image on my site to WebP?
Not necessarily all of them, but most photos and graphics on a page benefit from conversion, while backgrounds and icons sometimes stay in SVG format where that makes more sense.
Is AVIF always the better choice over WebP?
No. AVIF brings an additional 20 to 30% in savings, but takes longer to encode, so WebP is often more practical for dynamic content.
How does WebP affect a site's SEO ranking?
WebP improves loading speed and Core Web Vitals metrics, which indirectly affects ranking, since search engines factor page speed into their ranking criteria.
Do WebP images pose a security risk?
The risk is the same as with any other image format, so always serve images with proper HTTP headers and use trusted conversion tools to prevent malicious code being smuggled in through image files.
How much does it cost for Moxy-web to optimize the images on my site?
The price depends on the scope of the project and the current state of the site, so it's available on request through the Moxy-web website.
Recommended