rsvg-convert input.svg \
--width 2048 \
--keep-aspect-ratio \
--output output.pngUsing imagemagick
magick -background none -density 600 input.svg -resize 2048x2048 output.pngFor 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.pngShell 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 extglobTo fix problems with globstar(especially on MacOS), use this gist.