Skip to content

Instantly share code, notes, and snippets.

View revilowaldow's full-sized avatar
🌱
chilling

Lyra [he/him] revilowaldow

🌱
chilling
View GitHub Profile
@revilowaldow
revilowaldow / pdf-extract-images.py
Last active December 7, 2024 14:19 — forked from XBigTK13X/pdf-extract-images.py
A 5etools focused script to automate pdf image extraction and masking. Also generates a cover thumbnail
#! /usr/bin/python3
# IMPORTANT! This script requires a Unix based system. Such as Mac, Ubuntu, or Windows Subsystem for Linux (WSL) running under Windows. You cannot use it in Windows alone.
# The reason for this is that the poppler-utils dependency does not have all the required features on Windows.
# This script requires poppler-utils (containing: pdfimage, pdftoppm), imagemagick (containing: convert), and alive-progress (containing: alive_bar)
# If your pdf file contains jp2 images, you can either install libopenjp2-tools (containing: opj_decompress), or uncomment the line that indicates a large performance hit
# Example usage: python3 pdf-extract-images.py "Players Handbook.pdf" "PHB"