Skip to content

A Python project for generating Spot It! (a.k.a Dobble) cards.

Notifications You must be signed in to change notification settings

zeliboba7/spot-it-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spot It! Generator

A Python project for generating Spot It! (a.k.a Dobble) cards.

Description

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.

Getting Started

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

Required packages

  • circlify - circle packing layout algorithm
  • ReportLab - library for generating PDFs and graphics

Usage

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.

Running the tests

Run the tests for cards generation:

python3 -m unittest tests/test_cards.py

Acknowledgments

About

A Python project for generating Spot It! (a.k.a Dobble) cards.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%