title: Convert png images to lossy avif
body: <p>I try to compress my ~1MB pngs to get a smaller image.</p>
  <p>When I compress my images to jpeg with:</p>
  <pre><code>for i in card*.png ; do convert -resize 445x625 -background white -flatten &quot;$i&quot; ../medium/&quot;${i%.*}.jpg&quot; ; done
  </code></pre>
  <p>they end up about 100kb</p>
  <p>So I tried</p>
  <pre><code>for i in card*.png ; do echo $i; convert -resize 445x625 &quot;$i&quot; ../medium/&quot;${i%.*}.avif&quot; ; done 
  </code></pre>
  <p>which results in avif images ~400kb, I guess because they are losslessly compressed.</p>
  <p>How do I create lossy compressed avif images? And what would be a useful quality level to get images with the text still clearly readeable?</p>
  <p><em>(I use ImageMagick 6.9.10-23 on Ubuntu)</em></p>