<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Optimization on Stephen Ajulu</title><link>https://ajulu.netlify.app/tags/optimization/</link><atom:link href="https://ajulu.netlify.app/tags/optimization/feed.xml" rel="self" type="application/rss+xml"/><description>Hello, I'm Stephen Ajulu, a seasoned multidisciplinary tech professional with over a decade of experience. I build impactful solutions using design, tech, and engineering in the pursuit of impact.</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>ajulu.b22uf@aleeas.com (Stephen Ajulu)</managingEditor><webMaster>ajulu.b22uf@aleeas.com (Stephen Ajulu)</webMaster><copyright>Stephen Ajulu.</copyright><lastBuildDate>Sat, 25 Apr 2026 10:00:00 +0000</lastBuildDate><item><title>How to Use Optimized Images</title><link>https://ajulu.netlify.app/posts/image-optimization-demo/</link><pubDate>Sat, 25 Apr 2026 10:00:00 +0000</pubDate><guid>https://ajulu.netlify.app/posts/image-optimization-demo/</guid><description>&lt;p&gt;To keep your site fast and achieve high scores on Google PageSpeed Insights, you should use the new &lt;code&gt;img&lt;/code&gt; shortcode for any local images you add to your posts.&lt;/p&gt;
&lt;h2 id="why-use-the-img-shortcode"&gt;Why use the &lt;code&gt;img&lt;/code&gt; shortcode?&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;WebP Support:&lt;/strong&gt; It automatically generates a WebP version of your image, which is significantly smaller.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Responsive Loading:&lt;/strong&gt; It creates a &lt;code&gt;srcset&lt;/code&gt; so mobile devices download smaller versions of the image.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lazy Loading:&lt;/strong&gt; Images only load when they are about to enter the viewport.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic Dimensions:&lt;/strong&gt; Prevents layout shifts (CLS) by adding &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; attributes.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="how-to-use-it"&gt;How to use it&lt;/h2&gt;
&lt;p&gt;Instead of standard Markdown like &lt;code&gt;![Alt](path)&lt;/code&gt;, use this:&lt;/p&gt;</description><content:encoded><![CDATA[<p>To keep your site fast and achieve high scores on Google PageSpeed Insights, you should use the new <code>img</code> shortcode for any local images you add to your posts.</p>
<h2 id="why-use-the-img-shortcode">Why use the <code>img</code> shortcode?</h2>
<ol>
<li><strong>WebP Support:</strong> It automatically generates a WebP version of your image, which is significantly smaller.</li>
<li><strong>Responsive Loading:</strong> It creates a <code>srcset</code> so mobile devices download smaller versions of the image.</li>
<li><strong>Lazy Loading:</strong> Images only load when they are about to enter the viewport.</li>
<li><strong>Automatic Dimensions:</strong> Prevents layout shifts (CLS) by adding <code>width</code> and <code>height</code> attributes.</li>
</ol>
<h2 id="how-to-use-it">How to use it</h2>
<p>Instead of standard Markdown like <code>![Alt](path)</code>, use this:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">




  
  
  
    <img src="/images/me.jpg" alt="Stephen Ajulu"  loading="lazy">
  




</span></span></code></pre></td></tr></table>
</div>
</div><p><em>Note: The <code>src</code> path should be relative to the <code>assets/</code> or <code>static/</code> directory depending on where you store them, but it works best with images in <code>assets/</code> for full processing.</em></p>
<h2 id="example-in-action">Example in Action</h2>





  
  
  
    <img src="/images/me.jpg" alt="Stephen Ajulu" class="author-demo" loading="lazy">
  




<p>You can also pass a custom CSS class:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">




  
  
  
    <img src="/images/me.jpg" alt="Alt text" class="my-custom-class" loading="lazy">
  




</span></span></code></pre></td></tr></table>
</div>
</div>]]></content:encoded><media:content url="https://ajulu.netlify.app/images/me.jpg" medium="image"/></item></channel></rss>