0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00
penpot/experiments/scripts/quantize.sh
2020-06-18 20:08:46 +02:00

9 lines
445 B
Bash
Executable file

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