#!/bin/bash

FOREGROUND_SVG=$1

FOREGROUND_PNG="$FOREGROUND_SVG-traces.png"
FOREGROUND_TMP="$FOREGROUND_SVG.tmp.png"
BACKGROUND_PNG="$FOREGROUND_SVG-edges.png"


CMD="convert -density 1000 -borderColor white -border 20%x20% $FOREGROUND_SVG $FOREGROUND_TMP"
eval $CMD

CMD="convert $FOREGROUND_TMP -negate $FOREGROUND_PNG && rm $FOREGROUND_TMP"
eval $CMD

CMD="convert -density 1000 $FOREGROUND_SVG -threshold 100% -alpha off -negate
-borderColor black -border 20%x20% $BACKGROUND_PNG"

eval $CMD

