pycht icon indicating copy to clipboard operation
pycht copied to clipboard

✂️🎨 Streetart by clustering

pycht_logo

Street art by clustering.

Pics by @alys.cheshire

⚡️ Quick start

Take a nice picture :

Generate a 4 colors stencil model :

>> from pycht import Pycht

>> Pycht().stencil('cat.jpg', 'stencil_cat.jpg', 4)
Stencil 1 stencil 2 stencil 3 stencil 4

Final result rendering with all stencils :

Cut it, paint it, stare at it, leave it. Enjoy !

🛠 Installation

:snake: You need to install Python 3.6 or above.

Installation can be done by using pip. There are wheels available for Linux, MacOS, and Windows.

pip install pycht

You can also install the latest development version as so:

pip install git+https://github.com/tlentali/pycht

# Or, through SSH:
pip install git+ssh://[email protected]/tlentali/pycht.git

🥄 How ?

Behind this script, you will find algos used for marketing, financial prediction and client targeting. The pics is tranlated into a matrice, each value indicate a pixel color in three dimension. Then, a clustering algorithm is used to reshape the picture by colors. The number of colors desired is a parameter and is chosen directly by the user. As an output you have the picture with the number of color you choose and a picture by color to elaborate each stencils one by one.

🖖 Contributing

Feel free to contribute in any way you like, we're always open to new ideas and approaches. If you want to contribute to the code base please check out the CONTRIBUTING.md file. Also take a look at the issue tracker and see if anything takes your fancy.

This project follows the all-contributors specification. Again, contributions of any kind are welcome!

📜 License

pycht is free and open-source software licensed under the MIT license.