#!/bin/bash # usage: render.sh in.svg out.png size in=$(realpath "$1"); out=$(realpath -m "$2"); s=$3 tmp=$(mktemp --suffix=.html -p "$HOME/.tmp") echo "" > "$tmp" google-chrome --headless=new --disable-gpu --hide-scrollbars --default-background-color=00000000 --window-size=$s,$s --screenshot="$out" "file://$tmp" >/dev/null 2>&1 rm -f "$tmp"