Created
July 8, 2025 18:58
-
-
Save majenkotech/073b60acb27313acd2d3b476a3996f8b to your computer and use it in GitHub Desktop.
Makefile for converting JPG files into a monochrome PDF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PDF=MCV11-D_Reference_Card | |
CONTRAST=45 | |
PNGS=$(patsubst %.jpg,%.png,$(wildcard *.jpg)) | |
${PDF}-ocr.pdf: ${PDF}.pdf | |
ocrmypdf $^ $@ | |
${PDF}.pdf: ${PNGS} | |
magick $^ $@ | |
.SUFFIXES: .jpg .png | |
.jpg.png: | |
magick $^ -level ${CONTRAST}%,${CONTRAST}% -colors 2 -type bilevel $@ | |
clean: | |
rm -f *.png *.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment