createsvg.sh 304 B

12345678910111213141516
  1. #!/bin/sh
  2. INPUT="$1"
  3. OUTPUT="$2"
  4. CROPWIDTH="$3"
  5. CROPHEIGHT="$4"
  6. W=$CROPWIDTH
  7. H=$CROPHEIGHT
  8. SW=$((W * 8))
  9. SH=$((H * 8))
  10. BMP="${INPUT}.bmp"
  11. gm convert "$INPUT" -crop ${W}x${H} -filter Point -resize ${SW}x${SH} -black-threshold 50%% "$BMP"
  12. potrace "$BMP" -o "$OUTPUT" -i -a 1.01 -s -z black
  13. rm -f "$BMP"