wfc-cr
Version, currently main branch1 version
- main branchlatestSep 26, 2023
github.com/D-Shwagginz/wfc-cr
Crystal C-Bindings for https://github.com/krychu/wfc/tree/master used to generate images
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
wfc-cr:
github: D-Shwagginz/wfc-cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.9.2- License
- MIT
- Author
- D. Shwagginz
- Target
wfc-crfrom src/wfc-cr.cr
Dependencies
This version declares no dependencies.
README
wfc-cr
Crystal C-Bindings for krychu/wfc to create random images using wave function collapse
Installation
Linux
- Run
sh ./rsrc/install.sh
- Add
wfc-crto yourshard.ymldependencies like so:
dependencies:
wfc-cr:
github: D-Shwagginz/wfc-cr
Windows
- Follow the instructions at https://github.com/neatorobito/scoop-crystal to add the crystal-preview bucket to scoop
- Install crystal with
scoop install crystal - Run
.\rsrc\install.ps1in powershell - Run in powershell
$env:LIB="${env:LIB};C:\wfc"
$env:PATH="${env:PATH};C:\wfc"
OR
Run in cmd
set PATH=%PATH%;C:\wfc
set LIB=%LIB%;C:\wfc
Usage
Quick example:
require "wfc-cr"
input_image = WFC.image_load("Path/To/Image.png")
wfc = WFC.overlapping(128, 128, input_image, 3, 3, 1, 1, 1, 1)
WFC.run(wfc, -1)
output_image = WFC.output_image(wfc)
WFC.image_save(output_image, "Path/To/MyNewImage.png")
WFC.image_destroy(input_image)
WFC.image_destroy(output_image)
WFC.destroy(wfc)
Contributing
- Fork it (https://github.com/D-Shwagginz/wfc-cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- D. Shwagginz - creator and maintainer
- Sol-vin - provided the install scripts
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Sep 26, 2023
- Crystal
1.9.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/D-Shwagginz/wfc-cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1