mxgmn/wavefunctioncollapse

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 32 minutes ago
Added to GitGenius on September 2nd, 2026
Created on September 30th, 2016
Open Issues & Pull Requests: 9 (+0)
GitHub issues: Enabled
Number of forks: 1,354
Total Stargazers: 25,311 (+0)
Total Subscribers: 487 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

Wave Function Collapse is a procedural generation algorithm that creates bitmap and tilemap output by learning patterns from a single example image.

The tool solves the problem of generating new content that matches the style and structure of a reference image without requiring manual rule definition. It works by analyzing the input image to extract small tile patterns and their valid adjacencies, then uses a constraint-satisfaction approach inspired by quantum mechanics to synthesize new images. The algorithm iteratively assigns tiles to output positions while respecting the learned constraints, backtracking when conflicts arise to explore alternative valid configurations.

Developers should choose this tool when they need to generate game levels, textures, or other tilemap-based content that maintains visual coherence with a reference design. It suits projects where hand-crafting every variation is impractical but where the output should feel consistent with a particular aesthetic or structural style. The approach works well for small to medium-sized outputs and is particularly effective for stylized or abstract content where exact realism is not required. The tool is less suitable for generating large, highly detailed images or content requiring specific semantic meaning beyond pattern matching.

Development on the project shows active engagement with the core algorithm and exploration of variations. The codebase includes multiple implementations addressing different aspects of the generation problem, suggesting iterative refinement of the approach. Documentation and examples are maintained to support users in understanding how to apply the tool to their own images. The project demonstrates sustained interest in the underlying technique through continued updates and clarifications to the implementation.