# -*- makefile -*- # usage: IN=`echo *.jpeg` make -f ~/mk/jpeg2djvu.mk -j 3 DJVUS=$(IN:.ppm=.djvu) .PHONY: all all: out.djvu out.djvu: $(DJVUS) djvm -c out.djvu $(DJVUS) # Ordinary dither gives large files. What you really want is some # adaptive threshold algorithm (pamthreshold). DITHER=pamditherbw | pamtopnm # DITHER=pgmtopbm -threshold # Dither to B&W. This produces smaller files and seems ok for high res scans. %.djvu: %.ppm cat $< | ppmtopgm | $(DITHER) | pbmtodjvurle | csepdjvu -d 300 - $@