Skip to content

m1es/m1photobook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

m1photobook

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.

The flow

  • 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_original folder.
  • This will create a new folder called renamed. Move that folder to the root folder and rename it to images_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_raw folder
  • The python script will create an images folder 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

Bash script for numbering

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.

Install instructions

  • brew install exiftool
  • chmod +x order-images-by-date.sh

How to run

  • ./order-images-by-date.sh
  • ./order-images-by-date.sh --dry-run

Python script

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)

Install instructions

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/

How to run

Now run it: python3 square_images.py

LaTeX

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).

Install instructions

brew install --cask mactex

How to run

pdflatex main.tex

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors