https://github.com/dawidbieniek/wavefunctioncollapseimagegenerator
A simple WinForms application that generates images using the Wave Function Collapse algorithm, featuring automatic backtracking and a few built-in tilesets. Based on https://www.youtube.com/watch?v=rI_y2GAlQFM
https://github.com/dawidbieniek/wavefunctioncollapseimagegenerator
backtracking csharp dotnet image-generation procedural-generation wave-function-collapse winforms
Last synced: 3 months ago
JSON representation
A simple WinForms application that generates images using the Wave Function Collapse algorithm, featuring automatic backtracking and a few built-in tilesets. Based on https://www.youtube.com/watch?v=rI_y2GAlQFM
- Host: GitHub
- URL: https://github.com/dawidbieniek/wavefunctioncollapseimagegenerator
- Owner: dawidbieniek
- Created: 2024-11-02T19:18:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-04T18:21:38.000Z (3 months ago)
- Last Synced: 2025-03-04T19:26:22.127Z (3 months ago)
- Topics: backtracking, csharp, dotnet, image-generation, procedural-generation, wave-function-collapse, winforms
- Language: C#
- Homepage:
- Size: 1.84 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Wave Function Collapse Image Generator
A WinForms application that procedurally creates unique images using the Wave Function Collapse algorithm
## About
![Screenshot of Application][app-screenshot]This repository contains a lightweight WinForms app that leverages the Wave Function Collapse algorithm to generate images from build-in tilesets. The app simulates the "collapse" of each cell into one of several available states, resulting creation of different patterns.
### Built With
[![.NET][dotnet-badge]][dotnet-url][![WinForms][winforms-badge]][winforms-url]
### Features
- **Procedural Image Generation:** Utilizes the Wave Function Collapse algorithm to produce unique images.
- **Automatic Backtracking:** Recovers from dead-ends by reverting to previous valid states.
- **Multiple Tilesets:** Choose from several built-in tilesets to vary the output.
- **Generation Modes:** Watch the image form in real time or step through each step manually.
- **Saving Images:** Save generated images as PNG, BMP or JPG## Getting Started
The application is designed to run on Windows systems.
### Prerequisites
- **.NET 9.0 Desktop Runtime:** Ensure the runtime is installed. The app will prompt you to download it if not found.**.NET SDK:** Usually includes the runtime. If you can build the app, you should be able to run it as well.
### Installation
1. **Clone the Repository**
```sh
git clone https://github.com/dawidbieniek/WaveFunctionCollapseImageGenerator.git
```
2. **Build the Project**Navigate to the src/ directory and build the project:
``` sh
dotnet build -c Release
```
3. **Run the Application**Find the generated executable in the **bin/Release/net9.0-windows/** folder and launch it.
## Screenshots
### Different pattern each time
![Patterns][ss-patterns]### Several build-in tilesets
![Tilesets][ss-tilesets]### Backtracking allows fixing invalid cell states
![Backtracking][ss-backtracking][app-screenshot]: img/app-screenshot.png
[ss-patterns]: img/patterns.png
[ss-tilesets]: img/tilesets.png
[ss-backtracking]: img/backtracking.png
[dotnet-badge]: https://img.shields.io/badge/.NET-512BD4?style=for-the-badge&logo=dotnet&logoColor=white
[dotnet-url]: https://dotnet.microsoft.com/en-us/
[winforms-badge]: https://img.shields.io/badge/WinForms-512BD4?style=for-the-badge
[winforms-url]: https://learn.microsoft.com/en-us/dotnet/desktop/winforms/