
Image Mosaic Generator
Photos → mosaic art, vectorized
Each region is matched to its nearest tile in the corpus. Synthetic source + palette, reconstructed in your browser.
Watch a mosaic assemble from tiles in your browser.
Image Mosaic Generator, a graduate coursework project, transforms an input image into mosaic art by dividing it into a grid, computing each cell's average color via NumPy reshape/broadcast (no Python loops), and matching cells to the nearest tile using scikit-learn batch euclidean distances in RGB/LAB space. It adds K-means color quantization, Canny edge-aware adaptive grids, tile blending, and pickle-cached tile sets. The vectorized grid pass replaces a nested-loop baseline for a 12.3× speedup on 512×512 images (2.34s → 0.19s), peaking at 2,438 tiles/sec, and quality is measured with a real PSNR/SSIM/MSE/histogram-correlation pipeline (skimage + OpenCV) reporting SSIM 0.87 / PSNR 32.4 dB. Packaged as a Gradio app deployable to Hugging Face Spaces with five tile sets (256 colors, plus patterns, gradients, emojis and image tiles).
- Python
- NumPy
- OpenCV
- scikit-learn
- scikit-image
- Gradio
- Pillow
- SSIM
- 0.87
- PSNR
- 32.4 dB
- Vectorized speedup
- 12.3×
- Throughput
- 2,438 tiles/sec