Crates.io | wfc_image |
lib.rs | wfc_image |
version | 0.12.1 |
source | src |
created_at | 2018-12-27 07:47:39.540781 |
updated_at | 2022-05-08 06:13:02.547507 |
description | Create patterns for wfc using image files |
homepage | https://github.com/gridbugs/wfc.git |
repository | https://github.com/gridbugs/wfc.git |
max_upload_size | |
id | 104018 |
size | 49,732 |
A helper for wfc to simplify generating images based on image files, using the image crate.
Most of the sample images are taken from mxgmn/WaveFunctionCollapse.
This example generates an output image which is similar to the input image.
->
->
It's also possible to manually restrict the output to encode specific properties. In this example:
->
Pass the flag --animate
to view a realtime animation of the image being generated:
This is a general tool for displaying in realtime, the generation of an image from a specified image file.
->
->
->
cargo run --release --example=animate -- -i examples/cat.png -x100 -y60 -p3 --forever
cargo run --release --example=animate -- -i examples/flowers.png -x100 -y60 -p3 --all-orientations --forever
Takes the tile in the bottom-right corner and forces it to appear along the entire bottom and right sides of the output, wrapping to the top and left sides. This is an easy way to prevent the output from wrapping. Optionally, the bottom-right corner tile (which is often blank) can be removed from the choices of tiles for other cells.
The point of this example is to easily experiment with generating levels for roguelikes.
By default the bottom-right corner tile is removed from the possibilities for other cells:
cargo run --release --example=anchor -- -a -i examples/cat.png -o /tmp/a.png -p3 -x100 -y100
You can allow the bottom-right corner tile to appear in other tiles with the --allow-corner
flag.
cargo run --release --example=anchor -- -a -i examples/cat.png -o /tmp/a.png -p3 -x100 -y100 --allow-corner