Crates.io | greedytile |
lib.rs | greedytile |
version | 0.1.9 |
created_at | 2025-07-06 20:10:20.25866+00 |
updated_at | 2025-08-18 09:06:11.167392+00 |
description | Random greedy pixel pattern generation algorithm |
homepage | https://github.com/GeEom/greedytile |
repository | https://github.com/GeEom/greedytile |
max_upload_size | |
id | 1740414 |
size | 942,714 |
Fast pattern synthesis preserving local tile constraints. Safe Rust implementation with CLI and library interfaces.
Source | Generated | Visualized |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
# Install with Rust 1.88.0 or later
cargo install greedytile
# Generate pattern from source image
greedytile input.png
# Process directory of images including rotation, mirroring, and animation
greedytile ./patterns/ -r -m -v
Option | Description | Default | Without Option | With Option |
---|---|---|---|---|
--seed |
Seed reproducible generation | 42 | ![]() |
![]() |
--iterations |
Maximum iterations | 1000 | ![]() |
![]() |
--prefill |
Use content of <input>_pre.png |
disabled | ![]() |
![]() |
--visualize |
Generate placement animation | disabled | ![]() |
|
--width |
Maximum pixel width | unbounded | ![]() |
![]() |
--height |
Maximum pixel height | unbounded | ||
--rotate |
Enable 90°/180°/270° tile rotations | disabled | ![]() |
![]() |
--mirror |
Enable tile reflection | disabled | ![]() |
![]() |
--quiet |
Suppress progress output | verbose | ||
--no-skip |
Process overwriting existing output | skip existing |
GreedyTile generates patterns by placing 3×3 tiles extracted from a source image. Weights for randomly selecting placement are influenced by several factors:
For efficiency, the global balance correction uses a normal distribution to approximate what should technically be a binomial distribution. The approximation becomes accurate at large counts where it matters most.
The distance probability weighting has more impact on easily tiled patterns than complex ones. Restrictive patterns often have less valid tile choices, making the probabilistic selection less relevant.