This repository contains scripts to:
- Generate poker reference card images.
- Generate a rules summary card image.
- Arrange card images into printable grid pages.
- Python 3.10+
pip(or another Python package manager)- Pillow (
PIL)
From the repository root:
python -m venv .venvActivate the virtual environment:
macOS/Linux:
source .venv/bin/activateWindows PowerShell:
.venv\Scripts\Activate.ps1Install dependencies:
python -m pip install --upgrade pip PillowScript: Reference_Cards.py
python Reference_Cards.pyExpected outputs include files like:
hand_ranks_card_1.pnghand_ranks_card_2.pnghand_ranks_card_3.pnghand_ranks_card_4.png
Script: Rules_Card.py
python Rules_Card.pyExpected output:
rules_card.png
Script: Print_Card_Grid.py
Basic example (run from repo root):
python Print_Card_Grid.py --input "./Reference Cards" --output "./Reference Cards/print.png"This produces one or more page images such as:
print_01.pngprint_02.png
If only one page is needed, a single output page may be created.
python Print_Card_Grid.py \
--input "./Reference Cards" \
--output "./Reference Cards/print.png" \
--dpi 300 \
--page-size letter \
--margin-in 0.25 \
--gap-in 0.00Option notes:
--input: folder containing card images.--output:.pdffor multipage PDF, or image extension (like.png) for page image output.--page-size:letterora4.--margin-in: outer margin in inches.--gap-in: spacing between cards in inches (default is0.00, so cards touch edge-to-edge).
- The print-grid script assumes source images are already card-sized artwork (for example, generated by
Reference_Cards.pyandRules_Card.py). - The print-grid script automatically excludes its own generated output name and numbered pages from input discovery (for example, excludes
print.png,print_01.png,print_02.png, etc. when--output print.pngis used). - In some environments, PDF export can fail if Pillow lacks JPEG encoder support. If that happens, use image output (
.png) and print those pages.