Skip to content

Python implementation of a mosaic generator. A photomosaic is a large image composed of smaller tile images

License

Notifications You must be signed in to change notification settings

VeritasV/python-mosaic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • colorspacious

To install these packages, run:

pip install numpy opencv-python scikit-learn colorspacious

Usage

  1. Clone the repository:
git clone https://github.com/VeritasV/python-mosaic.git
  1. Navigate to the repository directory:
cd python-mosaic
  1. Place your base image in the repository directory and name it target.png
  2. Create a tiles directory in the repository and place your tile images inside it.
  3. Run the script:
python main.py
  1. 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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Python implementation of a mosaic generator. A photomosaic is a large image composed of smaller tile images

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages