[][src]Function wfc_tiled::grid_to_image

pub fn grid_to_image(grid: &Grid<u32>) -> DynamicImage

Convert a Grid to a DynamicImage.

This is only meant for preview purposes, if you don't want to use external software like Tiled.

The function simply creates an image where each pixel's color is based on the corresponding tile's ID in the grid.

For example, tile ID 22 is converted to RGBA(22, 0, 0, 255).

Examples

use wfc_tiled::grid_to_image;
 
let img = grid_to_image(&grid);
img.save("out.png").expect("Failed to save");