Free tool · runs in your browser

Collapse

Paint a tiny example, and a Wave Function Collapse solver learns which little patterns are allowed to touch and generates an endless, coherent tilemap — live, in front of you. No two runs are the same.

⚡ Runs 100% in your browser — nothing is uploaded
Your browser is missing Web Workers, which this tool needs. Try a current version of Chrome, Edge, Firefox, or Safari.
Example — draw or pick one

The solver only ever sees the little N×N tiles inside this drawing — that is all it uses to build the rules.

Ready

What you are looking at

Wave Function Collapse is a small idea with a big reputation among game developers. Give it one example image and it will produce as many new images as you like that all share the same local texture — the same little motifs, joined the same way — without ever repeating the original. It has been used to generate levels, textures, poetry and city maps. This is a full overlapping-model implementation, and every part of it runs on your machine.

01

Learn the tiles

An N×N window slides over your drawing and records every distinct little tile, and how common each one is.

02

Learn the rules

Two tiles may sit next to each other only where their overlapping pixels agree. That is the entire rulebook.

03

Collapse

Every output cell starts as every tile at once. The solver repeatedly picks the most-decided cell and commits it to one tile.

04

Propagate

Each choice ripples outward, deleting now-impossible tiles from neighbours, until the whole grid agrees. That is the shimmer you see resolving.

How is this running in my browser?

There is no server doing the work. When you press Generate, the example is handed to a Web Worker — a background thread — which extracts the patterns, compiles the adjacency table, and runs the observe-and-propagate loop. After every few steps it sends back a snapshot of the grid, where cells that have not decided yet are drawn as a blur of their remaining possibilities. That is why the picture looks like fog condensing into a scene. Because the heavy work lives off the main thread, the page stays smooth even on a large grid, and nothing you paint ever leaves your device.

Things to try

Draw two colours in stripes and watch it invent a striped world. Paint an island of one colour inside a sea of another and it will generate an archipelago. Switch the pattern size to 2×2 for looser, more surprising output, or 3×3 for output that hugs your example closely. Turn off wrapping to get pieces with clean edges you can drop into a game, or leave it on for seamless, tiling textures. Change the seed to get a completely different world from the same rules.

Is my drawing uploaded anywhere?

No. The example, the solver, and the result all stay in your browser. There is no network request for any of it, and it keeps working with your connection off.

Why does the output sometimes flash and restart?

WFC can reach a cell that has no legal tile left — a contradiction. Rather than produce a broken image it wipes the grid and retries with new randomness. Simpler examples, a smaller pattern size, and wrapped edges all make this rarer.

What is the difference between 2×2 and 3×3?

It is the size of the window used to learn tiles. Bigger windows capture more of your example’s structure, so the output looks more like the original but is less varied. Smaller windows are freer and more chaotic.

Can I use the results?

Yes. Whatever you make is yours — hit Save PNG and use it however you like.

Where did this algorithm come from?

Wave Function Collapse was introduced by Maxim Gumin in 2016. This is an independent implementation of his overlapping model, written from scratch to run in the browser.

I build tools like this every day.

Senior full-stack engineer, available for senior or contract work, fully remote. See the rest of the lab or get in touch.