Giter Club home page Giter Club logo

barnsley's Introduction

barnsley: Iterated Function Systems in Rust

Crates.io Crates.io CI

Make your own images like this! Look at at all the variety in the examples.

example image

Make your own!

You can use this website to generate your own IFS and animations right in the browser.

This website is built in the barnsley_gui repo.

How to run crate

Install

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.

From a template

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.

  1. Install with cargo install barnsley
  2. Using Rust, run barnsley construct example_template.toml > test.json
  3. Look at your picture in the test.png file and the configuration in test.json

From a config

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.

  1. Install with cargo install barnsley.
  2. Using Rust, run barnsley construct examples/example7.json
  3. Look at the example7.png file to see the result. Note how it matches the one in the examples directory!

Implemented transforms

  • LinearTransform
  • AffineTransform
  • MoebiusTransform
  • InverseJuliaTransform

Try different combinations of them to generate new images.

Origins

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.

barnsley's People

Contributors

dependabot[bot] avatar jmbhughes avatar

Stargazers

 avatar  avatar

Watchers

 avatar

barnsley's Issues

switch to `Parameter<T>` type for parameters

As a standardization of the interface for transforms, I should switch to a common Parameter<T> enum that contains the name and the value of the transform maybe. Then somehow make it so that all parameter names and values could be accessed. This is part of making it GUI friendly without a lot of custom code for each transform.

add IFS morph animations

You can slowly vary the parameters of an IFS to generate different visualizations smoothly. It would be cool to make animations of this change.

  • Prototype the idea
  • Settle on how to represent parameter tweens
  • Implement an IFSAnimation struct to store all systems in an animation
  • Make the animation serialize to a text file
  • Settle between Dioxus, Iced, or some other GUI framework
  • Implement a single transition GUI
  • Implement multiple transitions between many IFS systems

publish on crates.io

It would be nice to get this out there for people to use! That requires adding a license and cleaning up the code a bit.

add documentation

The code doesn't have much documentation and isn't getting released on docs.rs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.