A Python project for generating Spot It! (a.k.a Dobble) cards.
This projects generates the sheets with Spot It! cards. The images are randomly sized and rotated. The cards' images are laid out according to circle packing algorithm.
The placeholder numbered images can be generated by spotit/utilities/image_generator.py
. This is done with OpenCV library.
Clone the repository:
git clone https://github.com/LukasMaly/spot-it-generator.git
cd ./spot-it-generator
Install the required packages:
pip install -r requirements.txt
- circlify - circle packing layout algorithm
- ReportLab - library for generating PDFs and graphics
Copy input *.png images into ./images/
. Alternatively you can set another folder with - o
option (with -h
you can see more options). Preferably the images should have transparent background.
Default order of the game is 5 and number of images per card is 6, you need 31 input images for this order. Other possibilities see in the table blow. The order can b set with -O
option:
order | images per card | images required |
---|---|---|
2 | 3 | 7 |
3 | 4 | 13 |
5 | 6 | 31 |
7 | 8 | 57 |
Run it:
python3 main.py
The result sheet will be rendered into cards.pdf
.
Run the tests for cards generation:
python3 -m unittest tests/test_cards.py
- William Radigan for pySpot-It (https://github.com/WRadigan/pySpot-It) used for generating Spot It! like number sets.