Skip to content

Instantly share code, notes, and snippets.

@StoneLabs
Created June 2, 2026 10:33
Show Gist options
  • Select an option

  • Save StoneLabs/1ad7129b7ef0997be31ebcb169d0b302 to your computer and use it in GitHub Desktop.

Select an option

Save StoneLabs/1ad7129b7ef0997be31ebcb169d0b302 to your computer and use it in GitHub Desktop.
PDF: Light to Dark mode
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