Skip to content

Instantly share code, notes, and snippets.

@shoorick
Created December 19, 2018 20:46
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 shoorick/93e8bedef0c60cb447bb4d611f63cd38 to your computer and use it in GitHub Desktop.
Save shoorick/93e8bedef0c60cb447bb4d611f63cd38 to your computer and use it in GitHub Desktop.
Makefile for trimming PNG files and making them 2-bit black and white
SRC=.
DST=2b
FILES=*.png
trim $(DST)/$(FILES): $(SRC)/$(FILES)
for file in $(SRC)/$(FILES); do \
[ ! -f $(DST)/$$file -o $(SRC)/$$file -nt $(DST)/$$file ] \
&& echo $$file \
&& convert $(SRC)/$$file -dither none -colors 2 -trim +repage $(DST)/$$file; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment