Mosayc turns a main picture into a mosaic of smaller pictures.
Project description
Mosayc
Mosayc turns a main picture into a mosaic of smaller pictures.
- Free software: MIT
- Documentation: https://balouf.github.io/mosayc/.
- Github: https://github.com/balouf/mosayc
Story
A few years ago, I wanted to make a special gift for the birthday of my partner. A friend suggested to build a photo wall, but I recalled then that she liked jigsaws... So what about a personalized jigsaw?
The gift was appreciated! And a few years later, I decided to release the code I used. Enjoy!
Features
There are already many tutorials to build a mosaic from a bunch of tile pictures, e.g. here or there (this is far from being exhaustive).
So... what makes Mosayc different? Mostly its use case: make a personalized memory-lane that you can offer as a gift (print as a poster, a jigsaw puzzle, use as screensaver of background...).
- All proposals I found so far are based on finding the closest tile for each mixel (mosaic pixel). As a result, most of the time, you just use a small subset of your tiles (the ones with the good colors) that you copy many times. And you still have no guarantee that the colors will be right in the hand. In contrast:
- Mosayc leverages $b$-matching theory, a technique that ensures that all your tiles will occupy roughly the same number of mixels (and you control the redundancy): all your pictures will be included!
- Mosayc can adjust the color of your tiles so they correspond to what you want (and you control the adjustment).
- Mosayc can have tiles of different aspect ratios and orientations.
- Mosayc can tilt the tiles so the result looks a bit homemade.
- It's packaged with a nice CLI, so you can make mosaics without worrying about the computation.
Quickstart
Install Mosayc:
$ pip install mosayc
Use Mosayc in a Python project:
>>> from mosayc import Mosayc
>>> mosayc = Mosayc(input='mypicture.jpeg', tiles_dir='mydir')
>>> img = mosayc.compute()
Use the resulting Pillow image as you want!
Use Mosayc CLI:
CLI help:
$ mosayc --help
Example:
$ mosayc -I myipcture.jpeg -D mydir -O mymosaic.jpeg
Credits
This package was created with Cookiecutter and the Package Helper 3 project template.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mosayc-0.1.0.tar.gz.
File metadata
- Download URL: mosayc-0.1.0.tar.gz
- Upload date:
- Size: 12.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcc0ad9d8fb648c45e55639e88b66bcc374ac0f3257850982e35bf32e9ad59c4
|
|
| MD5 |
837e754ca93d245257084f07bcb9b323
|
|
| BLAKE2b-256 |
e1729933398c03f3352bccb6de397d3eb8098e820a1fb785559acc1c4d338245
|
File details
Details for the file mosayc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mosayc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddea5eecfa7a34170bb50744cf351ddbe8b4eddbf873c1e4b4d95b620fe3219a
|
|
| MD5 |
baf908c66a6df53b859d410044e97688
|
|
| BLAKE2b-256 |
b1999f065439bf571b3d826905a3c9fd014b048b771ac70c20cf65466fd072b5
|