Crate franklin

Source
Expand description

A utility for generating images through evolution.

This crate provides utilities, as well as CLI tool called franklin-cli for generating evolutionary art. Generation of evolutionary art can be separated into three steps:

  • mutation,
  • calculating fitness and selection,
  • breeding the specimens.

§Usage

This example shows the minimal code for setting up the generation. All settings are set to default. Only one property it required: source image.

use franklin::{EnvironmentBuilder, ImageReader};

fn run_simulation() {
    let mut environment_builder = EnvironmentBuilder::default();

    let image = ImageReader::load("./example.png").unwrap();
    environment_builder.set_image(image);

    let environment = environment_builder.build().unwrap();
    environment.run().unwrap();
}

Modules§

crossover
This module contains utilities used to breed specimens.
fitness
This module contains utilities used to calculate the fitness of specimens.
mutators
This module contains utilities used to mutate specimens.

Structs§

EnvironmentBuilder
This builder provides an interface to set up the environment for generating images.
ImageReader
This struct can be used to load an image from the filesystem.

Enums§

ColorMode
This enum specifies different options for choosing color mode.
DisplayCondition
This enum specifies different options for choosing which images should be displayed on the screen.
SaveCondition
This enum specifies different options for choosing which images should be saved on the filesystem.