Created
June 2, 2026 10:33
-
-
Save StoneLabs/1ad7129b7ef0997be31ebcb169d0b302 to your computer and use it in GitHub Desktop.
PDF: Light to Dark mode
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
| mkdir -p pages | |
| # Render at 600 DPI | |
| pdftoppm -r 600 -png "Light-Mode.pdf" pages/page | |
| # Dark mode conversion | |
| for f in pages/*.png; do | |
| magick "$f" \ | |
| -colorspace HSL \ | |
| -channel Lightness \ | |
| -negate \ | |
| +channel \ | |
| "$f" | |
| done | |
| # Reassemble | |
| magick pages/*.png "Dark-Mode.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment