Skip to main content

Create jigsaw puzzle pieces from an image

Project description

A jigsaw puzzle pieces generator that levels the playing field.

This script may change a lot as I have yet to really use it for any active projects.

It basically creates jigsaw puzzle pieces in two formats: svg, 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. It currently uses potrace, and imagemagick convert subprocesses.

Installing

Requires:

Python Packages:

Other Software needed:

If on ubuntu or other debian based distro:

$ apt-get install imagemagick potrace libffi-dev python-libxml2 libxml2-dev python-lxml

Install with pip in editable mode for developing and such:

$ pip install -e .

Usage

See the script.py for more. Not everything has been implemented, but to create 100 randomly generated jigsaw puzzle pieces:

./bin/piecemaker --dir test  --number-of-pieces 100 test.jpg

Some in progress notes and such

These notes and such are probably outdated...

just clips - only create a clips svg file

clips - specify a clips svg file

compute adjacent - adds the adjacent piece id’s to each piece in JSON file.

minimum piece size - Will change the count of pieces to meet this requirement

max pixels - Will scale down the original image to meet this requirement

scaled sizes - output multiple scaled versions of piece pngs

Outputs:

clips svg file

adjacent.json - Lists each piece and their adjacent pieces

Directory:

pieces/
  full/ - unscaled version
    pieces.json - JSON file with pieces info
    pieces/
      directory with piece png files
  scaled-50/ - scaled 50% version (set by 'scaled sizes' option)
    pieces.json - JSON file with pieces info
    pieces/
      directory with piece png files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piecemaker-0.2.4.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file piecemaker-0.2.4.tar.gz.

File metadata

  • Download URL: piecemaker-0.2.4.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for piecemaker-0.2.4.tar.gz
Algorithm Hash digest
SHA256 26b5f473666b04a784831f28dd55b9047f0674917d0a43e4a99f2338e314e97b
MD5 aed107cf96fa3b4221282df6c070b33c
BLAKE2b-256 8ae3b7193a7e5553180cda5ad76f143e449c57af2206a5fc5ac9cee2febc21b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page