Created
December 11, 2012 20:20
-
-
Save coderofsalvation/4261783 to your computer and use it in GitHub Desktop.
comicize scanned handdrawings into curvy vectordrawings (for simple webcomics and such)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ ! -n "$1" ]] && echo "usage: $0 <image> <outimage> <title> <thickness=200> <whiteoffset=20> <tracetreshold=15> <curvetreshold=4> <zoom=2>" && exit 1 | |
file="$1" | |
outfile="$2" | |
title="$3" | |
thickness="$4" | |
whiteoffset="$5" | |
tracetreshold="$6" | |
curvetreshold="$7" | |
zoom="$8" | |
bitmap="$file.bmp" | |
convert -resize "$thickness" -normalize -level $whiteoffset%,99% "$file" "$bitmap" | |
cat "$bitmap" | mkbitmap -f "$curvetreshold" -s "$zoom" -t 0.49 | potrace -t "$tracetreshold" -a 1.33 -O 50 -b pgm > "$file.pgm" | |
convert -fill black -pointsize 14 -gravity South -annotate +0+8 "$title" \ | |
-fill blue -pointsize 9 -gravity northeast -annotate +0+5 "copyright leon.vankammen.eu" \ | |
-bordercolor '#555555' -border 2x2 "$file.pgm" "$outfile" | |
#rm *.bmp *.pbm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment