Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veritasv/python-mosaic
Python implementation of a mosaic generator. A photomosaic is a large image composed of smaller tile images
https://github.com/veritasv/python-mosaic
image-processing image-segmentation mosaic mosaic-images photomosaic photomosaic-generator python python3
Last synced: about 2 months ago
JSON representation
Python implementation of a mosaic generator. A photomosaic is a large image composed of smaller tile images
- Host: GitHub
- URL: https://github.com/veritasv/python-mosaic
- Owner: VeritasV
- License: mit
- Created: 2023-05-21T15:16:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-21T15:38:41.000Z (over 1 year ago)
- Last Synced: 2024-11-07T16:47:06.650Z (3 months ago)
- Topics: image-processing, image-segmentation, mosaic, mosaic-images, photomosaic, photomosaic-generator, python, python3
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Photomosaic Generator
This repository contains a Python implementation of a photomosaic generator. A photomosaic is a large image composed of smaller tile images. This project allows you to create your own photomosaic using a base image and a directory of tile images.
## How it Works
The photomosaic generator works by first calculating the average color of each tile image and the corresponding region in the base image. It then uses a K-D tree, an efficient data structure for nearest-neighbor searches, to find the tile image that most closely matches the color of each region in the base image. The result is a mosaic image that closely resembles the original base image.
## Requirements
- Python 3.7 or above
- NumPy
- OpenCV
- scikit-learn
- colorspaciousTo install these packages, run:
```sh
pip install numpy opencv-python scikit-learn colorspacious
```## Usage
1. Clone the repository:
```sh
git clone https://github.com/VeritasV/python-mosaic.git
```2. Navigate to the repository directory:
```sh
cd python-mosaic
```3. Place your base image in the repository directory and name it target.png
4. Create a tiles directory in the repository and place your tile images inside it.
5. Run the script:```sh
python main.py
```5. The resulting mosaic image will be saved in the current directory.
## Contributing
Your contributions are always welcome! Please create a pull request to add new algorithms, improve the current implementation, or fix bugs.
## Support
If you find this project helpful or interesting, please consider supporting me on [BuyMeACoffee](https://www.buymeacoffee.com/UH0mejbw8U).
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.