png2gif

Convert a folder of .png into an animated .gif.

convert -delay 30 -loop 0 -layers Optimize *.png out.gif

Naturally, this works not olny for .png and all other options of Imagemagick can be used as well.

convert -resize 256x256\> -delay 30 -loop 0 -layers Optimize *.svg out.gif

png2vp9

Convert a folder of .png files into a weboptimized VP9, which is supported by all important Browsers.

ffmpeg -f image2 -pattern_type glob -i "img*.png" -c:v libvpx-vp9 -pass 1  \
    -b:v 1000K -threads 1 -speed 4 -tile-columns 0 -frame-parallel 0 \
    -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 -an -f null -


ffmpeg -f image2 -pattern_type glob -i "img*.png" -c:v libvpx-vp9 -pass 2 \
    -b:v 1000K -threads 1 -speed 0 -tile-columns 0 -frame-parallel 0 \
    -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 -c:a libopus -b:a 64k \
    -f webm video.webm

For maximum compatibility create a MP4 as fallback.

ffmpeg -an -f image2 -pattern_type glob -i "img*.png" -vcodec libx264 \
    -pix_fmt yuv420p -profile:v baseline -level 3 video.mp4

Embed with:

<video>
  <source src="path/to/video.webm" type="video/webm; codecs=vp9,vorbis">
  <source src="path/to/video.mp4" type="video/mp4">
</video>

optipng

Optimize .png images. Smaller size, no quality loss.

optipng -o7 *.png