This repo holds a couple of scripts I use to convert a collection of images into a printable photo book. More specifically, I use it to convert my favorite phone pictures from an entire year and create a yearbook out of it.
The scripts where generated by ChatGPT 5 somewhere in December 2025.
- Download images from iCloud (manually)
- Create a folder called 'Yearbook 202X' (root folder)
- Inside that folder, put the downloaded images in a folder called
images_original - Run the bash script inside the
images_originalfolder. - This will create a new folder called
renamed. Move that folder to the root folder and rename it toimages_raw. - That folder contains images named 001.jpg, 002.jpg, etc.
- Run the python script from the Yearbook root folder, it looks for the
images_rawfolder - The python script will create an
imagesfolder where it stores all the squared images - Run the LaTeX script, it will use the squared images and create a PDF with all images listed in a 3x3 grid
Put the script order-images-by-date.sh into a directory containing images.
The script will sort all the images using exiftool and rename the files
so that it ends up with 001.jpg, 002.jpg, etc.
The files that it cannot date will end up last. So let's say the first 100 images can be dated and the last 10 can not, then those last 10 are named 101.jpg, 102.jpg, .., 110.jpg.
brew install exiftoolchmod +x order-images-by-date.sh
./order-images-by-date.sh./order-images-by-date.sh --dry-run
The goal of the script is to square all images and put a blur on the edges. This way the images can be used in a grid based photobook with 3x3 images on each page.
It takes an input directory (images_raw) and creates an output directory (images)
- Python >= 3.9
- Download fonts (https://dejavu-fonts.github.io/Download.html)
- optional:
export PATH=$PATH:~/Homebrew/opt/python@3.14/libexec/bin
python3 -m venv venv
source venv/bin/activate
pip install opencv-python pillow numpy
project/
├── square_images.py
├── images_raw/
│ ├── 001.jpg
│ ├── 002.jpg
│ ├── 003.jpg
│ └── ...
└── images/
Now run it: python3 square_images.py
This template requires an 'images' folder that it reads images from that are named 001.jpg, 002.jpg, etc. It will generate a PDF file with a 3x3 image grid on each page. The page size is 21x21 cm, ready for print!
Before running, make sure to change the page count on line 79 (the foreach loop).
brew install --cask mactex
pdflatex main.tex