WaveForge

WaveForge

What is

WaveForge

?

WaveForge is a web application, that serves as a somewhat user-friendly playground used for generating images from samples or unique tilesets, utilizing the Wave Function Collapse algorithm.

The project was created by Dávid Butyka as a university thesis.

The algorithm

Wave Function Collapse (WFC) is a procedural content generation algorithm inspired by quantum mechanics. Despite the fancy name, it's not that hard to understand and is mainly used for generating patterns like images or even texts by following a set of local rules — kind of like solving a puzzle one piece at a time.

Image generation with WFC works by observing the possibilities at each cell in a grid and gradually narrowing down the options until a complete, valid solution is formed. It's commonly used in games and tools for generating tile-based levels, textures, and worlds that feel natural and coherent.

Here is a very simple description of the algorithm:

WFC algorithm

Key concepts:

  • ◾ Entropy = Number of possible tile options in a cell
  • ◾ Collapse = Choose one tile from possible options
  • ◾ Propagation = Filter neighbors' options to ensure compatibility

Models

Wave Function Collapse (WFC) comes in two main flavors, each with its own strengths and ideal use cases.

Overlapping Model

The Overlapping model is more automatic and works by sampling a source image. It looks at small patterns (like 3x3 pixel chunks), learns how they appear next to each other, and uses that data to generate larger images that resemble the original.

This model is great when you want to:

  • ◾ Generate textures or pixel-style art
  • ◾ Recreate the feel of a source image
  • ◾ Avoid hand-defining rules — it learns them for you

It’s like teaching the algorithm by example — show it a pattern, and it dreams up a new one that looks similar.

SimpleTiled Model

The SimpleTiled model works with predefined tiles and their allowed neighboring relationships. You, the user, tell the algorithm which tiles can be placed next to each other (top, right, bottom, left), and it builds a grid by respecting those adjacency rules.

This makes it ideal for:

  • ◾ Pixel art, tilesets, or hand-designed tiles
  • ◾ Strict control over layout logic
  • ◾ 2D maps, platformer levels, or dungeon generation

It's like building a mosaic where each piece must fit perfectly with its neighbors.

You can learn more about WFC in the following pages:

Generating images

There are generally two methods of image generation with WFC. On WaveForge you can try both!

Overlapping

The Overlapping model allows for sample based image generation, meaning that you only need to upload a small sample image, play around with the algorithm parameters, and just click generate! Then the algorithm will "analyze" the sample and construct a completely random, new image that features only the valid patterns and rules shown by the sample.

Parameters

There are certain generation parameters that you can change, to better describe the sample or the expected output.

Here is what they mean:

  • Sample size (number, min: 2, max: 16): describes the size (N×N) of each pattern when scanning the image
  • Periodic input (bit): tells the algorithm whether your sample image is a continuos texture or not. (The left edge connects to the right and the top edge to the bottom.)
  • Periodic output (bit): this parameter controls whether the generated output wraps around at the edges, just like a seamless tile. (The left edge connects to the right and the top edge to the bottom.)
  • Symmetry (number, min: 1, max: 8): determines how many rotated and/or flipped versions of each pattern are considered as valid alternatives.
  • Ground (number, min: -1, max: [number of patterns - 1]): it forces a specific pattern to always appear on the bottom row of the output, making it behave like a “ground tile”.
Overlapping help gif

SimpleTiled

The SimpleTiled model allwos for a tileset based image generation. You need to upload a tileset and configure the adjacency rules for the available tiles. After that the algorithm will basically randomly assemble a new image according to the configuration you set. This method requires way more user effort as you need to have a good understanding of the proccess and a precise configuration, otherwise the algorithm can run into contradictions very easily. There is only one real algorithm parameter for this model, which defines wether or not the output should be periodic or not.

Parameters

There are certain generation parameters that you can change, to better describe the sample or the expected output.

Here is what they mean:

  • Width (number, min: 2, max: 128): width of the output in tiles.
  • Height (number, min: 2, max: 128): height of the output in tiles.
  • Periodic output (bit): this parameter controls whether the generated output wraps around at the edges, just like a seamless tile. (The left edge connects to the right and the top edge to the bottom.)
  • Animation (bit): decides weather you want to see the full process of the grid cells collapsing and the image being generated. (HAS HIGH INFLUENCE ON PERFORMANCE)
Simpletiled help gif

Following the generations you can directly download the image, or save it to your profile if you are signed in.

Drawing samples

You can draw your own images and use them as samples for the Overlapping model generation even without the need of downloading the sample. It is a basic pixel canvas drawing tool. You can set the width and the height of the canvas and also the cellsize, but the later only matters for the visibility during drawing.

After drawing you can download, or copy your image to the clipboard and paste it into the Overlapping model page or even back to the drawing canvas. This way you can use these images without downloading them.

Drawing tool help gif

Clipboard

With the clipboard tool you can move sample images between pages without downloading them. It works just like a normal text clipboard, you can copy images while in the application and paste it to appropriate pages.

You can only copy one image at once.

There are two locations where you can copy images from in the application and also two locations where you can paste images into. You can copy from the drawing tool or any sample image from public uploaded images, and then you can insert these into the drawing tool or the Overlapping model.

Or more simply, if you see this:
you can copy, and if you see this:
you can paste.

WaveForge

by Dávid Butyka

Creator's social

Leave your feedback