Skip to content
プロジェクト

概要

Random greedy pixel pattern generation algorithm

デザイン・メディア

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
履歴を収集中
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

GreedyTile

Crates.io CI Rust unsafe forbidden MIT licensed codecov

Fast pattern synthesis preserving local tile constraints. Safe Rust implementation with CLI and library interfaces.

Examples

Source Generated Visualized
Source A Result A Vis A
Source B Result B Vis B
Source C Result C Vis C
Source D Result D Vis D
Source E Result E Vis E
Source F Result F Vis F
Source G Result G Vis G

Installation and usage

# 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

Options

Option Description Default Without Option With Option
--seed Seed reproducible generation 42 Default Seed Custom Seed
--iterations Maximum iterations 1000 Default Iterations Fewer Iterations
--prefill Use content of <input>_pre.png disabled No Prefill Prefill Enabled
--visualize Generate placement animation disabled Tile Placement Animation
--width Maximum pixel width unbounded Unbounded Bounded
--height Maximum pixel height unbounded
--rotate Enable 90°/180°/270° tile rotations disabled No Rotation Rotation Enabled
--mirror Enable tile reflection disabled No Mirror Mirror Enabled
--quiet Suppress progress output verbose
--no-skip Process overwriting existing output skip existing

Details

GreedyTile generates patterns by placing 3×3 tiles extracted from a source image. Weights for randomly selecting placement are influenced by several factors:

  1. Entropy weighting: Prioritizes positions where fewer tile options are valid (similar to WFC)
  2. Global balance correction: If pixels are under-represented then selection is biased towards the source balance
  3. Distance-based probabilities: Pixel distance patterns in the source are replicated in the output
  4. Deadlock recovery: If no choices exist which respect tiles, pixels in a local area are removed before continuing

Limitations

  • Fixed tile size: Currently hardcoded to sample 3×3 pixel tiles from the source
  • Extensibility: Would be improved by a plugin interface for adding new probability rules

関連プロジェクトを探す

読み込み中…