Paint A Wave Function Collapse

Paint A Wave Function Collapse is a Python application developed in the PyGame engine that is able to run inside of a web browser with the use of WebAssembly.

The Wave Function Collapse Algorithm is an algorithm that can procedurally generate new images from on the patterns of a smaller base tile sample. This application allows the user to paint their own base tile samples and then watch the Wave Function Collapse Algorithm procedurally generate an image from the sample.

Since the application is multi-threaded, the image will get gradually updated as the algorithm is executing, and the UI remains responsive during this period.

NOTE: This application runs significantly slower in the browser compared to on the desktop because the technology to host PyGame applications using WebAssembly is still very new and unoptimized.


More information about the project can be found on GitHub!

Click to view larger image

Python
PyGame
HTML
CSS
JavaScript
WebAssembly