Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2016 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1853b5d13093d3c27a0b93db42045055 to your computer and use it in GitHub Desktop.
Save anonymous/1853b5d13093d3c27a0b93db42045055 to your computer and use it in GitHub Desktop.
Blocky potrace
#!/bin/bash
argv=("$0" "$@") # $# == ${#argv[@]} + 1
last=${argv[$#]}
newwidth=$(( $(identify -format "%w" -- "$last") * 10))
newheight=$(( $(identify -format "%h" -- "$last") * 10))
# select every arg but last and argv[0]
mkbitmap -n -s 1 -o - -- "$last" | # -n turns off filtering
convert -scale "${newwidth}x${newheight}" -- - - | # convert does a blocky scale
/usr/bin/potrace "${argv[@]:1:$#-1}" -r 10 -a 0 -- -
@HyperHCl
Copy link

HyperHCl commented Nov 4, 2016

modified (or idea) from https://gist.github.com/bendmorris/7170209
save this as /usr/local/bin/potrace to cheat fontforge

* $# == ${#argv[@]} - 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment