8 lines
473 B
Bash
Executable File
8 lines
473 B
Bash
Executable File
#!/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 "<html><body style='margin:0;background:transparent'><img src='file://$in' width=$s height=$s style='display:block'></body></html>" > "$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"
|