broodysubset192's profile picture

Published by

published
updated

Category: Web, HTML, Tech

Finished binding WFC to Crystal!

Completely finished binding the WFC C-Library to Crystal!

You can now use Crystal with WFC C functions by using my wfc-cr library

WFC is an image generation library used to create images from a small sample image:

Images mapping the sample image to the WFC image

Using the WFC C-Library with Crystal is now super easy:

require "wfc-cr"

input_image = LibWFC.image_load("Path/To/Image.png")

wfc = LibWFC.overlapping(128, 128, input_image, 3, 3, 1, 1, 1, 1)

LibWFC.run(wfc, -1)

output_image = LibWFC.output_image(wfc)

LibWFC.image_save(output_image, "Path/To/MyNewImage.png")

LibWFC.image_destroy(input_image)
LibWFC.image_destroy(output_image)
LibWFC.destroy(wfc)


0 Kudos

Comments

Displaying 0 of 0 comments ( View all | Add Comment )