# -*- makefile -*- # usage: IN=`echo *.jpeg` make -f ~/mk/jpeg2djvu.mk -j 3 # The idea is to make this work on a debian install with the packages: # psutils netpbm imagemagick djvulibre IN := $(shell ls *.png) PSS := $(IN:.png=.ps) .PHONY: all all: out.pdf out.ps: $(PSS) psmerge -oout.ps $(PSS) out.pdf: out.ps ps2pdf out.ps out.pdf # Ordinary dither gives large files. What you really want is some # adaptive threshold algorithm (pamthreshold)., but the settings below # don't work well. DITHER=pamditherbw | pamtopnm # DITHER=pamthreshold -dual=10x10 ## this doesn't work well with these settings # DITHER=pgmtopbm -threshold # Dither to B&W. This produces smaller files and seems ok for high res scans. # %.ps: %.jpeg # cat $< | jpegtopnm | $(DITHER) | pnmtops -dpi 300 >$@ %.ps: %.pnm pnmtops -dpi 300 <$< >$@ %.pnm: %.png convert $< $@