Create jigsaw puzzle pieces from an image
Project description
A jigsaw puzzle pieces generator that levels the playing field.
Currently in use by Puzzle Massive to create puzzles with 5000+ pieces.
It creates jigsaw puzzle pieces in multiple formats: svg, jpg, and png. The number and size of pieces are set by passing the script different options. It takes a while to run if doing a lot of pieces. Extra JSON files are created with details on size of pieces and adjacent pieces information which is commonly used when verifying that two pieces can join together.
Installing
Requires:
Python Packages:
Other Software needed:
If on ubuntu or other debian based distro:
$ sudo apt-get --yes install libspatialindex6 $ sudo apt-get --yes install optipng $ sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - $ sudo apt-get install -y nodejs $ sudo apt-get --yes install python3-pil $ sudo apt-get --yes install potrace libffi-dev libxml2-dev python3-lxml python3-xcffib $ sudo npm install -g svgo svpng
Install with pip in editable mode for developing and use virtualenv to isolate python dependencies:
$ python3 -m venv . $ source ./bin/activate $ pip install -e .
Usage
See the script.py for more. Not everything has been implemented. Use this example command to create 100 randomly generated jigsaw puzzle pieces from test.jpg image. This assumes that the ‘test’ directory (mkdir test) and test.jpg exist:
piecemaker --dir test --number-of-pieces 100 test.jpg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file piecemaker-0.4.0.tar.gz
.
File metadata
- Download URL: piecemaker-0.4.0.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 417458a3c1fdeb814591d89e55d57a931e4137faacf9b0267557e69dfe02705a |
|
MD5 | 1d9e788de3c444ac754796c94d7c56e5 |
|
BLAKE2b-256 | 00e447deadb1d88e666e0ba6f893bd7dfe6f7e3da9e10fee39e50ec0934329bf |