Skip to main content

Mosayc turns a main picture into a mosaic of smaller pictures.

Project description

Mosayc

PyPI Status Build Status Documentation Status License: MIT Code Coverage

Mosayc turns a main picture into a mosaic of smaller pictures.

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?

A fake Picasso made of Kandinski's

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


Download files

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

Source Distribution

mosayc-0.1.0.tar.gz (12.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mosayc-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

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

Hashes for mosayc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dcc0ad9d8fb648c45e55639e88b66bcc374ac0f3257850982e35bf32e9ad59c4
MD5 837e754ca93d245257084f07bcb9b323
BLAKE2b-256 e1729933398c03f3352bccb6de397d3eb8098e820a1fb785559acc1c4d338245

See more details on using hashes here.

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

Hashes for mosayc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddea5eecfa7a34170bb50744cf351ddbe8b4eddbf873c1e4b4d95b620fe3219a
MD5 baf908c66a6df53b859d410044e97688
BLAKE2b-256 b1999f065439bf571b3d826905a3c9fd014b048b771ac70c20cf65466fd072b5

See more details on using hashes here.

Supported by

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