0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00
penpot/experiments/scripts/quantize.sh

10 lines
445 B
Bash
Raw Permalink Normal View History

2020-06-18 13:08:22 -05:00
EDGE_THRESHOLD=0.1
INPUT=`basename $1 .bmp`
bmptoppm $1 > tmp/$INPUT.ppm
ppmtopgm tmp/$INPUT.ppm > tmp/$INPUT.pgm
pgmedge tmp/${INPUT}.pgm > tmp/$INPUT-edge.pgm
pgmtopbm -threshold -value ${EDGE_THRESHOLD} tmp/$INPUT-edge.pgm > tmp/${INPUT}-${EDGE_THRESHOLD}.pbm
pnmcomp -alpha tmp/${INPUT}-${EDGE_THRESHOLD}.pbm black_1600x800.ppm tmp/$INPUT.ppm > tmp/$INPUT-aliased.ppm
ppmquant -map palette.ppm tmp/$INPUT-aliased.ppm > tmp/$INPUT-quant.ppm