SnippetsSnippets
image2Clear
rsvg-convert input.svg \
  --width 2048 \
  --keep-aspect-ratio \
  --output output.png

Using imagemagick

magick -background none -density 600 input.svg -resize 2048x2048 output.png

For transparent backgrounds, SVG exports are transparent by default. To add a white background with ImageMagick:

magick -background white -density 600 input.svg -resize 2048x -alpha remove output.png

Shell script to convert all files in directory to webp, with default params, or standard cwebp params passed from command.

#!/bin/bash

PARAMS=('-m 6 -q 70 -mt -af -progress')

if [ $# -ne 0 ]; then
	PARAMS=$@;
fi

cd $(pwd)

shopt -s globstar nullglob nocaseglob extglob

To fix problems with globstar(especially on MacOS), use this gist.