wfc_image 0.8.0

Create patterns for wfc using image files
Documentation

Wave Function Collapse for Image Files

Version Documentation

A helper for wfc to simplify generating images based on image files, using the image crate.

Examples

Most of the sample images are taken from mxgmn/WaveFunctionCollapse.

Simple

This example generates an output image which is similar to the input image.

Rooms Input -> Rooms Output1 Rooms Output2

Bricks Input -> Bricks Output1 Bricks Output2

Flowers

It's also possible to manually restrict the output to encode specific properties. In this example:

  • The bottom row of patterns is set to be ground.
  • A sprout pattern is placed in a random position along the bottom of the output.
  • Ground patterns are forbidden from being automatically chosen.
  • The flower pattern is forbidden to appear in the bottom few rows of output, to enforce a minimum height of flowers.

Flowers Input -> Flowers Output1 Flowers Output2

Pass the flag --animate to view a realtime animation of the image being generated:

Flowers Animation

Animate

This is a general tool for displaying in realtime, the generation of an image from a specified image file.

Link Input -> Link Animation

Sewers Input -> Sewers Animation

Cat Input -> cat Animation