Skip to content

Instantly share code, notes, and snippets.

@n370
Last active April 9, 2017 18:04
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 n370/c1cc9e90c06f5c63f20caf8ad9b862f3 to your computer and use it in GitHub Desktop.
Save n370/c1cc9e90c06f5c63f20caf8ad9b862f3 to your computer and use it in GitHub Desktop.
Convert all images inside a given folder from coloured to grayscale, tweak it's black and white dither levels and trace it to a SVG vector file.
#!/bin/bash
for f in *.jpg; do convert $f -colorspace gray -channel Gray -level 10,80% -brightness-contrast 10x90% -channel All -threshold 20 bmp:- | potrace -s - -o $f.svg ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment