High Performance
Optimized for speed with parallel processing, SIMD operations, and k-d tree search (O(log n) complexity)
Create stunning mosaic images by intelligently replacing sections of a target image with smaller material images based on perceptual color similarity.
Transform any image into a detailed mosaic composed of thousands of smaller images:
# Install dependencies
cargo build --release
# Basic usage
./target/release/mosaic-rust \
--target photo.jpg \
--material-src ./materials \
--output mosaic.jpg
# High quality settings
./target/release/mosaic-rust \
--target photo.jpg \
--material-src ./materials \
--output mosaic.jpg \
--grid-w 100 --grid-h 75 \
--max-materials 2000 \
--adjacency-penalty-weight 0.25 \
--color-adjustment-strength 0.4 \
--optimization-iterations 2000
Original Image
Generated Mosaic (24,000 tiles)
Feature | Description |
---|---|
Perceptual Color Matching | Uses Lab color space with k-d tree for O(log n) nearest neighbor search |
Smart Placement | Multi-factor scoring considering color distance, usage limits, and adjacency penalties |
Parallel Processing | Automatic parallelization with Rayon for multi-core performance |
Color Adjustment | HSV-based color adjustment for better matching with target regions |
Optimization Engine | Simulated annealing algorithm for iterative tile placement improvement |
Real-time Visualization | ASCII grid display and progress tracking with ETA |
Similarity Database | Pre-computed similarity matrix with JSON persistence |
Aspect Ratio Matching | Intelligent filtering with fallback strategies |
The Mosaic Art Generator is built with a modular architecture:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Material β β Similarity β β k-d Tree β
β Loading βββββΆβ Database βββββΆβ Indexing β
β (Parallel) β β (Cached) β β (O(log n)) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Grid β β Tile β β Color β
β Generation βββββΆβ Placement βββββΆβ Adjustment β
β (Target) β β (Multi- β β (HSV) β
β β β factor) β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Optimization β β Image β β Final β
β (Simulated βββββΆβ Assembly βββββΆβ Mosaic β
β Annealing) β β (Parallel) β β Output β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
Ready to create your first mosaic? Follow our comprehensive guide:
Ready to create stunning mosaic art? Get Started β