mosaicGenerator / README.md
Peter Idoko
updated readme
5ed2f4c

A newer version of the Gradio SDK is available: 5.29.1

Upgrade
metadata
title: mosaicGenerator
app_file: app.py
sdk: gradio
sdk_version: 5.13.2

Interactive Image Mosaic Generator

Overview

This project creates a mosaic by segmenting an input image into a grid of tiles and replacing each tile with the closest-matching image from a predefined database.

Installation

Prerequisites

Ensure you have Python 3.8+ and install the required dependencies:

pip install gradio opencv-python numpy scipy joblib argparse scikit-image   

Usage

Basic Execution

To run the mosaic generator:

python mosaic_generator.py

Command-Line Arguments

You can modify the script to accept command-line arguments using argparse:

python mosaic_generator.py --input path/to/image.jpg --database path/to/database --output output.jpg --tile-size 5

Configuration Options

IMAGE_SIZE: Size of the input image (default: 300x300).
TILE_SIZE: Size of individual tiles (smaller = more detail).
GRID_SIZE: Automatically calculated based on TILE_SIZE.
DATABASE_FOLDER: Path to the folder containing the image tiles.

Performance Improvements

Uses parallel processing and a KD Tree for faster execution.

Author

Peter Chibuikem Idoko

Date

2025-02-03