Crates.io | barnsley |
lib.rs | barnsley |
version | 0.2.3 |
source | src |
created_at | 2023-08-05 16:41:09.984979 |
updated_at | 2024-02-04 09:51:47.951258 |
description | iterated function system image generator |
homepage | |
repository | https://github.com/jmbhughes/barnsley |
max_upload_size | |
id | 936577 |
size | 68,191 |
Make your own images like this! Look at at all the variety in the examples.
You can use https://barnsley.dev to generate your own IFS and animations right in the browser.
This website is built in the barnsley_gui repo.
Rust is required to run this code. Installation of Rust is easy though.
Once you have rust, install Barnsley with cargo install barnsley
.
Then, you can run from a template or a config.
A template toml file specifies the image properties, the evaluation properties, and which transforms to run.
Since you have not specified the parameters of the transforms, they're generated randomly.
This is an example template.
You can use the construct
command in the program to generate a specific instance of parameters and then evaluate it
to create an image.
cargo install barnsley
barnsley construct example_template.toml > test.json
A config json file specifies the image properties, the evaluation properties, and the specific parameters of transforms. It can be used to recreate an image at a later date.
Install with cargo install barnsley
.
Using Rust, run barnsley construct examples/example7.json
Look at the example7.png file to see the result. Note how it matches the one in the examples directory!
Try different combinations of them to generate new images.
This code is based on pyifs written by James Tauber for Python.
The crate name is in honor of Michael Barnsley, a leading researcher of iterated function systems.