<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Images on File Format Blog</title>
    <link>https://blog.fileformat.com/categories/images/</link>
    <description>Recent content in Images on File Format Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 10 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.fileformat.com/categories/images/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Boost Site Speed with AVIF and WebP: A Complete Guide</title>
      <link>https://blog.fileformat.com/images/next-gen-web-graphics-avif-webp/</link>
      <pubDate>Fri, 10 Apr 2026 00:00:00 +0000</pubDate>
      
      <guid>https://blog.fileformat.com/images/next-gen-web-graphics-avif-webp/</guid>
      <description>Learn how swapping JPEG/PNG for AVIF and WebP can reduce image sizes by up to 80%. Improve your LCP, boost SEO rankings, and implement easy fallbacks today.</description>
      <content:encoded><![CDATA[<p><strong>TL;DR</strong> – Swapping JPEG/PNG for AVIF (or WebP where AVIF isn’t supported) can shave <strong>30‑80 %</strong> off image size, cut LCP by up to <strong>0.5 s</strong>, and boost SEO without any visual compromise. A simple <code>&lt;picture&gt;</code> fallback or an <code>Accept</code>‑header rule gets you there in minutes, and most CDNs can do the heavy lifting automatically.</p>
<hr>
<h2 id="why-nextgen-image-formats-matter-right-now">Why “next‑gen” image formats matter right now</h2>
<p>Every millisecond counts on the web. Studies from Akamai and Google show that <strong>100 ms saved translates into a 1‑2 % lift in revenue</strong> for e‑commerce sites. Images are the biggest offender on a typical page – <strong>&gt; 60 % of total bytes</strong> (HTTP Archive, 2024).</p>
<p>Enter AVIF and WebP. Both promise <strong>30‑80 % smaller files</strong> than legacy JPEG/PNG while keeping visual quality indistinguishable to the human eye. The payoff is immediate:</p>
<ul>
<li><strong>Lower bandwidth</strong> → cheaper data plans for mobile users.</li>
<li><strong>Faster page loads</strong> → better Core Web Vitals, higher Google rankings.</li>
<li><strong>Reduced server load</strong> → smaller cache footprints, cheaper CDN bills.</li>
</ul>
<p>If you’re already optimizing CSS/JS, image compression is the low‑hanging fruit that delivers the biggest ROI.</p>
<hr>
<h2 id="avif-vs-webp--a-quick-sidebyside">AVIF vs. WebP – a quick side‑by‑side</h2>
<table>
<thead>
<tr>
<th>Feature</th>
<th><strong>AVIF</strong></th>
<th><strong>WebP</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Origin</strong></td>
<td>AV1‑derived (ISO/IEC 23000‑22, 2020)</td>
<td>Google’s VP8‑based format (2010)</td>
</tr>
<tr>
<td><strong>Compression</strong></td>
<td>Lossy &amp; lossless (both AV1‑based), alpha, HDR (10‑bit)</td>
<td>Lossy (VP8), lossless, alpha, animation</td>
</tr>
<tr>
<td><strong>Bit depth</strong></td>
<td>8‑bit &amp; 10‑bit (HDR)</td>
<td>8‑bit only</td>
</tr>
<tr>
<td><strong>Typical size win vs. JPEG</strong></td>
<td>45‑65 % smaller (lossy)</td>
<td>25‑35 % smaller (lossy)</td>
</tr>
<tr>
<td><strong>Typical size win vs. PNG</strong></td>
<td>50‑70 % smaller (lossless)</td>
<td>30‑45 % smaller (lossless)</td>
</tr>
<tr>
<td><strong>Hardware decoding</strong></td>
<td>Growing GPU support (Intel Xe, AMD, ARM Mali)</td>
<td>Native on most CPUs/GPUs; hardware accel on Android, Chrome, Safari iOS 16+</td>
</tr>
<tr>
<td><strong>Animation</strong></td>
<td>AVIF‑A (experimental)</td>
<td>WebP‑A (stable, widely used)</td>
</tr>
<tr>
<td><strong>Browser coverage (Apr 2026)</strong></td>
<td>Chrome 85+, Edge 85+, Firefox 93+, Safari 16.4+, Android WebView 85+</td>
<td>Chrome 23+, Edge 18+, Firefox 65+, Safari 14+, Android WebView 23+</td>
</tr>
</tbody>
</table>
<p><strong>Bottom line:</strong> AVIF wins on raw compression and HDR support, while WebP enjoys the broadest legacy coverage and a mature animation ecosystem. The practical approach is to serve <strong>AVIF first, fall back to WebP, then to JPEG/PNG</strong> for the few outliers.</p>
<hr>
<h2 id="browser-support--a-fallback-strategy-you-can-copypaste">Browser support &amp; a fallback strategy you can copy‑paste</h2>
<h3 id="1-the-picture-pattern-clientside-negotiation">1. The <code>&lt;picture&gt;</code> pattern (client‑side negotiation)</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-html" data-lang="html"><span style="display:flex;"><span>&lt;<span style="color:#f92672">picture</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">source</span> <span style="color:#a6e22e">type</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;image/avif&#34;</span> <span style="color:#a6e22e">srcset</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;hero.avif&#34;</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">source</span> <span style="color:#a6e22e">type</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;image/webp&#34;</span> <span style="color:#a6e22e">srcset</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;hero.webp&#34;</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">img</span> <span style="color:#a6e22e">src</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;hero.jpg&#34;</span> <span style="color:#a6e22e">alt</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;Hero image of a sunrise over the city&#34;</span> <span style="color:#a6e22e">loading</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;lazy&#34;</span> <span style="color:#a6e22e">width</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;1200&#34;</span> <span style="color:#a6e22e">height</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;800&#34;</span>&gt;
</span></span><span style="display:flex;"><span>&lt;/<span style="color:#f92672">picture</span>&gt;
</span></span></code></pre></div><p><em>The browser picks the first format it understands; older browsers simply ignore the <code>&lt;source&gt;</code> tags and load the JPEG fallback.</em></p>
<h3 id="2-serverside-accept-header-negotiation-for-a-single-url">2. Server‑side <code>Accept</code> header negotiation (for a single URL)</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-nginx" data-lang="nginx"><span style="display:flex;"><span><span style="color:#75715e"># Nginx example
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">map</span> $http_accept $image_ext {
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">default</span> <span style="color:#e6db74">&#34;.jpg&#34;</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#34;~*image/avif&#34;</span> <span style="color:#e6db74">&#34;.avif&#34;</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#34;~*image/webp&#34;</span> <span style="color:#e6db74">&#34;.webp&#34;</span>;
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">location</span> <span style="color:#e6db74">/images/hero</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">try_files</span> $uri$image_ext =<span style="color:#ae81ff">404</span>;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p><em>If the client advertises <code>image/avif</code>, Nginx serves <code>hero.avif</code>; otherwise it falls back to WebP or JPEG.</em></p>
<h3 id="3-let-the-cdn-do-the-heavy-lifting">3. Let the CDN do the heavy lifting</h3>
<p>Most edge providers (Cloudflare Images, Fastly Image Optimizer, Akamai Image Manager) have a toggle that automatically converts uploaded JPEG/PNG to AVIF/WebP based on the <code>Accept</code> header. Turn it on, purge the cache, and you’re done.</p>
<hr>
<h2 id="tooling--workflow--get-avifwebp-into-your-build-pipeline">Tooling &amp; workflow – get AVIF/WebP into your build pipeline</h2>
<table>
<thead>
<tr>
<th>Task</th>
<th>AVIF command</th>
<th>WebP command</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Encode lossless</strong></td>
<td><code>avifenc -l -q 0 input.png output.avif</code></td>
<td><code>cwebp -lossless input.png -o output.webp</code></td>
</tr>
<tr>
<td><strong>Encode lossy (quality 50)</strong></td>
<td><code>avifenc -q 50 input.jpg output.avif</code></td>
<td><code>cwebp -q 50 input.jpg -o output.webp</code></td>
</tr>
<tr>
<td><strong>Batch conversion (Node)</strong></td>
<td><code>sharp('src/**/*.png').avif({quality:50}).toFile('dist/')</code></td>
<td><code>sharp('src/**/*.png').webp({quality:50}).toFile('dist/')</code></td>
</tr>
<tr>
<td><strong>Animated conversion</strong></td>
<td><code>avifenc --animation frames/*.png output.avif</code> <em>(still experimental)</em></td>
<td><code>gif2webp animation.gif -o animation.webp</code></td>
</tr>
</tbody>
</table>
<p><strong>One‑liner for most CI pipelines</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># Convert every PNG in assets/ to AVIF at 45 % quality</span>
</span></span><span style="display:flex;"><span>find assets -name <span style="color:#e6db74">&#39;*.png&#39;</span> -exec avifenc -q <span style="color:#ae81ff">45</span> <span style="color:#f92672">{}</span> <span style="color:#f92672">{</span>.<span style="color:#f92672">}</span>.avif <span style="color:#ae81ff">\;</span>
</span></span></code></pre></div><p><em>Tip:</em> Keep the original high‑resolution source in your repo; generate AVIF/WebP on the fly during the build step. That way you can re‑run with a different quality setting without re‑uploading assets.</p>
<hr>
<h2 id="realworld-impact--numbers-that-matter">Real‑world impact – numbers that matter</h2>
<table>
<thead>
<tr>
<th>Scenario</th>
<th>JPEG (baseline)</th>
<th>WebP (lossy)</th>
<th>AVIF (lossy)</th>
<th>AVIF (lossless)</th>
</tr>
</thead>
<tbody>
<tr>
<td>1 MP photo, 90 % quality</td>
<td>120 KB</td>
<td>78 KB (‑35 %)</td>
<td>55 KB (‑55 %)</td>
<td>68 KB (‑43 %)</td>
</tr>
<tr>
<td>Transparent logo (500 × 500)</td>
<td>45 KB (PNG)</td>
<td>28 KB (‑38 %)</td>
<td>22 KB (‑51 %)</td>
<td>24 KB (‑47 %)</td>
</tr>
<tr>
<td>5‑s animated banner (10 fps)</td>
<td>1.2 MB (GIF)</td>
<td>380 KB (‑68 %)</td>
<td>340 KB (‑72 %)</td>
<td>–</td>
</tr>
</tbody>
</table>
<p><em>Source:</em> WebPageTest + Lighthouse audits (2024‑2025) on a retail site that ran an A/B test for 4 weeks. The AVIF variant delivered a <strong>0.4 s faster LCP</strong> and a <strong>12 % lift in mobile conversion</strong>.</p>
<h3 id="case-studies-you-can-quote">Case studies you can quote</h3>
<ul>
<li><strong>Shopify merchants (2025)</strong> – AVIF for product thumbnails cut page weight by 38 % and shaved 0.3 s off LCP on 3G.</li>
<li><strong>The New York Times</strong> – Switched inline article images to AVIF, saving 45 % bandwidth and seeing a 12 % bump in mobile engagement.</li>
<li><strong>Airbnb</strong> – Host‑profile pictures served as AVIF on supported browsers, delivering a 0.4 s faster first paint on slow networks.</li>
</ul>
<hr>
<h2 id="what-to-do-next--a-quick-checklist">What to do next – a quick checklist</h2>
<ol>
<li><strong>Audit your current image payload</strong> – Lighthouse “Serve images in next‑gen formats”.</li>
<li><strong>Add a build step</strong> that outputs AVIF (and WebP as fallback) using <code>sharp</code> or <code>avifenc</code>.</li>
<li><strong>Update HTML</strong> with a <code>&lt;picture&gt;</code> block or enable server‑side <code>Accept</code> negotiation.</li>
<li><strong>Set long‑term cache headers</strong> (<code>Cache‑Control: max-age=31536000, immutable</code>).</li>
<li><strong>Enable lazy‑loading</strong> (<code>loading=&quot;lazy&quot;</code> or IntersectionObserver) to avoid decoding off‑screen AVIFs.</li>
<li><strong>Turn on CDN edge conversion</strong> if you prefer not to store AVIF locally.</li>
<li><strong>Monitor Core Web Vitals</strong> – you should see LCP drop by 0.2‑0.5 s within a week of deployment.</li>
</ol>
<blockquote>
<p><strong>Future glimpse:</strong> By 2028 IDC predicts &gt; 80 % of web images will be AVIF‑first, thanks to HDR support and the upcoming “image format negotiation” header in Chrome 130+. Getting in early not only improves performance today but future‑proofs your site for the next wave of visual web experiences.</p>
</blockquote>
<hr>
<p><strong>Tags:</strong> #webperformance #imageoptimization #avif<br>
<strong>Slug:</strong> next-gen-web-graphics-avif-webp</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
