<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<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/"
	>
<channel>
	<title>avif &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/avif/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Wed, 30 Apr 2025 08:06:01 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>avif &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[How to fake AVIF thumbnail images]]></title>
		<link>https://shkspr.mobi/blog/2021/04/how-to-fake-avif-thumbnail-images/</link>
					<comments>https://shkspr.mobi/blog/2021/04/how-to-fake-avif-thumbnail-images/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 30 Apr 2021 11:48:02 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[avif]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[HTML]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=38785</guid>

					<description><![CDATA[AVIF is the hip new image format. It is born out of video compression technology. Modern video streaming services have a complicated relationship with multiple resolutions. A video is usually encoded several time - for high, medium, and low bandwidths. When you start streaming, your playback device usually picks the lowest quality stream to start with. If it downloads it quickly, then it jumps to …]]></description>
										<content:encoded><![CDATA[<p>AVIF is the hip new image format. It is born out of video compression technology. Modern video streaming services have a complicated relationship with multiple resolutions. A video is usually encoded several time - for high, medium, and low bandwidths. When you start streaming, your playback device usually picks the lowest quality stream to start with. If it downloads it quickly, then it jumps to the higher resolution.  You may have noticed this when the first few seconds of a streaming show are blocky and horrible, only to snap into a higher resolution.</p>

<p>But, sadly, AVIF doesn't have that.  There is a <a href="https://github.com/AOMediaCodec/av1-avif/issues/102">long discussion</a> about bringing thumbnails to the file format - and there is a possibility that it will be <a href="https://github.com/AOMediaCodec/libavif/issues/605">coming soon</a>.</p>

<p>In the meantime, here's how to fake a thumbnail for an AVIF picture.  You will need a modern browser with AVIF enabled to view these examples.</p>

<p>The trick is that AVIF can be highly effective at low resolutions.</p>

<ol>
<li>Take your original JPG image and reduce it in size to, say, 5%.</li>
<li>Using <a href="https://github.com/kornelski/cavif-rs">CAVIF</a> - or your favourite encoder - create the <em>lowest possible</em> quality conversion.

<ul>
<li><code>cavif --speed=1 --quality=1 small.jpg</code></li>
</ul></li>
<li>Base64 encode the resultant image.</li>
<li>Set it as the background-image in your CSS:</li>
</ol>

<pre><code class="language-_">&lt;img
    width=1024
    height=768
    alt="Graffiti saying Misfits Welcome."
    style="background-image: url('data:image/avif;base64,AAAAFGZ0eXBhdmlmAAAAAG1pZjEAAACgbWV0YQAAAAAAAAAOcGl0bQAAAAAAAQAAAB5pbG9jAAAAAEQAAAEAAQAAAAEAAAC8AAACiQAAACNpaW5mAAAAAAABAAAAFWluZmUCAAAAAAEAAGF2MDEAAAAARWlwcnAAAAAoaXBjbwAAABRpc3BlAAAAAAAAAOYAAACtAAAADGF2MUOBAAAAAAAAFWlwbWEAAAAAAAAAAQABAgECAAACkW1kYXQSAAoJP935awtAQ0BUMvkEZh55TLQkb5Dz/DAM7DVQAFYBBC4EpeaYrQU02SMcyibnGwpWdJ9O5rKJX07oUMJYxx3w8OFjy6qGZ80TWDMInxBNSG8yK4+Xn6AOFntHwgHqPP5nQl/SeOAZdYDwGz94ETf8C2HgnSu05TbWOz2QUImbJ6LDQLCiB2kJzscFG+eCVnPZk75b1ZDOQ12rcgctsQ0hn5iOJfK8Ihsa+TaOmHiV3G3EwZdYsFglrahpgxAc0QcLY95TnkKjG7HaIv26+KUW8WzhQFyl8GqVUiuGkpYHNUZCgoJtrrf+b+TiUPf0WZ6S8m5K4OY9ZyqPnDiLuDVVglYV4jP3KUVZ4XjowWxfvuX2HqWgTWFskIUcCvoZVQ3zZIkIEmrH3K1M0WeeForNzCw1BB6AhY163x6HtXklunu2hwn3VASqzg3kl0nZIMFSwEBctgVB211rP/dQKw2D10XNEfxk2ekThwhCyQ9PCXBGE+oloAcR6EWIy21tafNILd1kK1Y+KMqhTG5FwLdGm8Y2Z1OBlJWGKhZvhvDgz501cXUbgyLFXjAIHWWRidROV4TD2rw20KecpKncYU707TmjsLMwX9zyhp4P5zgmp2WUaJJWnuD1VwMn35/pDlPw/rcE0fUO0SkWdamdNC8h2k1gK4XtL8NRIUby9LgzPtqZl/twMFK1Kk+Mwbxxf6UmzV4IvvD4VWh8SQwzOX+1NcVb2E5pvcT+VpC4+tGXMY8JDP34IWbGN+AcC/DIAkCaY/p8DoNfQVCVZXTwdF/8I/gN6Mk08miJQuvuRNZAT0zIu3AwUiV1CtgA76g3ZhPYZgdHWS6jKcwQ0DdoYnY35S5Mn1qA');
        background-repeat:no-repeat; 
        background-size: 1024px 768px;"
    loading="lazy"
    src="Big.avif"
/&gt;
</code></pre>

<p>Here's what it looks like while the main image is loading (you may need to <a href="https://caniuse.com/avif">enable AVIF in your browser</a>:</p>

<img width="1024" height="768" alt="Graffiti saying Misfits Welcome." style="background-image: url('data:image/avif;base64,AAAAFGZ0eXBhdmlmAAAAAG1pZjEAAACgbWV0YQAAAAAAAAAOcGl0bQAAAAAAAQAAAB5p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-size: 1024px 768px;">

<p>Obviously, it isn't pretty! But it will allow <em>something</em> to be displayed while your full resolution image is slowly loading.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=38785&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/04/how-to-fake-avif-thumbnail-images/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
