Last active
July 8, 2025 11:59
-
-
Save matejaputic/b81a6b897faed06855228f02c5895ac2 to your computer and use it in GitHub Desktop.
Make Dark Mode 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
| #!/usr/bin/env zsh | |
| PATH=/opt/homebrew/bin:$PATH | |
| DIR=$(dirname "$1") | |
| FILENAME=$(basename "$1" .pdf) | |
| magick -density 600 "$1" \ | |
| -background white -alpha remove \ | |
| -auto-level \ | |
| -brightness-contrast 50 -clamp \ | |
| -fuzz 7% -fill "#202020" -opaque white \ | |
| -fuzz 5% -fill "#E0E0E0" -opaque black \ | |
| -filter Lanczos -resize 50% \ | |
| -compress Zip -quality 100 \ | |
| "$DIR/$FILENAME-dark.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment