Skip to content

Creating a source image for the WFC ‐ overlapping model

Kathy edited this page Jan 28, 2025 · 12 revisions

Creating a source image to use in the Wave Function Collapse - Overlapping model.

We will be using Piskel to create our source image. Piskel is a free application that you can use in the browser. It is available on Google but not Safari.

Click on Create Sprite

create

Grid size

We will set the grid size at 8 x 8 pixels. You can adjust by clicking on RESIZE.

resize

Grid Spacing

We will set the grid size to 1 pixel.

grid

Palette selection

You can edit the color palette by clicking on the pen icon.

manage_palette

After choosing a new color to add to the palette, click save.

palette

Choosing colors

Click on a color to choose it. Notice that the chosen color (tangerine) has a yellow triangle in the bottom left corner. Add the color to the grid by clicking on an individual square in the grid. You can also add the color to more than one square at a time by dragging your mouse. It is probably best to stick to 2 - 3 colors when designing your image, as source images with many different colors are more likely to lead to conflicts in the overlapping model.

choose-color

You can also fill the entire grid with a single color by clicking on the pitcher icon.

fill

Saving the source image

Once you are happy with your source image, you can save it by clicking on the export button. (I have just altered the colors of the city.png for illustrative purposes.)

export

Piskel is designed to created sprite animations. Since we only want one image, we will click on the option to save a single frame.

save

Looking at your source image in p5.js

Once you have your source image, you can look at it and the extracted tiles here.

look-at-tlle

Use your image in the WFC - Overlapping model

Now it is time to try your image in the WFC - overlapping model! Here is the result of the source image I created:

rendered