#!/bin/bash # render.sh [bg] — renders an SVG at size×size with headless Chrome (transparent by default). svg=$1; size=$2; out=$3; bg=${4:-transparent} html=$(mktemp "${TMPDIR:-/tmp}/icon-render.XXXXXX.html") printf '' "$bg" "$svg" "$size" "$size" > "$html" "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new --disable-gpu --hide-scrollbars --default-background-color=00000000 --force-device-scale-factor=1 --allow-file-access-from-files --window-size=$size,$((size+0)) --screenshot="$out" "file://$html" >/dev/null 2>&1 rm -f "$html"