What's the best tool(s) for optimizing/shirinking lossy the folling formats JPEG, PNG, MP4 (to WEBM/AV1) and GIF (convert GIF to WEBM/VP9 maybe?)?<p>Thanks!
You can convert gifs to video with ffmpeg:<p><pre><code> ffmpeg -i image-%04d.png anim.mp4
</code></pre>
You can use imagemagick ('convert' command) to make small gifs with dither, color reduction:<p><pre><code> convert image-*.png +dither -colors 10 dither.gif
convert image-*.png -ordered-dither 2x2 ordered_dither2.gif
convert image-*.png -ordered-dither 4x4 ordered_dither4.gif
convert image-*.png -colors 10 less_colors.gif</code></pre>
I encode MP4s with the H265 codec. For GIFs I use Photoshop's Export with a preview and reduce the colours until the quality starts to degrade noticeably.