← Directory

WaveFunctionCollapse

Open Source
★ 25,111 • Updated Aug 15, 2026, 07:17 PM

WaveFunctionCollapse is an open-source implementation of the Wave Function Collapse algorithm, originally introduced by Maxim Gumin.

Use Cases ▼
01

Generating game levels from sample tilemaps

02

Creating seamless textures from a small image

03

Procedural dungeon and map generation

04

Artistic pattern synthesis and experimentation

05

Educational demonstration of constraint solving

What Problem It Solves ▼

WaveFunctionCollapse solves the problem of generating large, non-repetitive textures, tilemaps, and patterns from a single small example. It automates the creation of locally consistent content, significantly reducing manual design effort in games, art, and procedural generation.

Key Features ▼
✓

Simple to use with a single input example

✓

Produces high-quality, locally similar outputs

✓

Supports both overlapping and simple tiled models

✓

Open source with permissive MIT license

✓

Widely referenced and ported

Overview

WaveFunctionCollapse is an open-source implementation of the Wave Function Collapse algorithm, originally introduced by Maxim Gumin. The repository contains a C# program that generates bitmap images and tilemaps from a single input example, using constraints derived from local patterns. It supports both the Simple Tiled Model, which works with predefined tiles and adjacency rules, and the Overlapping Model, which extracts patterns directly from an input image.

Full Description ▼

The algorithm treats the output grid as a superposition of possible states for each cell and repeatedly collapses cells to concrete states based on the constraints, propagating information to neighboring cells to maintain consistency. This produces outputs that are locally similar to the input but globally novel, making it suitable for procedural content generation.

The project includes a Windows desktop application with a graphical interface for loading inputs, adjusting parameters, and viewing results. It has been widely adopted and ported to many other languages and game engines, serving as a reference implementation for the technique.

Pros & Cons

Pros

+

Simple to use with a single input example

+

Produces high-quality, locally similar outputs

+

Supports both overlapping and simple tiled models

+

Open source with permissive MIT license

+

Widely referenced and ported

Cons

−

Windows-only desktop application

−

Requires manual parameter tuning

−

Performance may degrade for large outputs

−

Limited to 2D grids

−

Not packaged as a reusable library

Similar Tools

DeBroglie MarkovJunior ConvChain Tessera Model Synthesis Texture Synthesis (Efros & Leung)

More in Code