franklin

franklin-ci Crates.io docs.rs Crates.io

A utility for generating evolutionary art.

What is art?
Something more than sum of its parts.

Description

There are two utilities here: franklin-cli allowing you to generate images through your command line and franklin, a rust library with some out-of-the-box utilities. It also allows you to define your own components to customize generation even more.

The underlying process is my implementation of Evolutionary algorithm. The whole process can be split into three parts:

Usage

The crate is published on crates.io. You can install it with:

sh cargo install franklin

cargo is a rust package manager. See here how to set up rust environment.

If you want to start a simulation it's best to check all available options in franklin-cli:

sh franklin-cli --help

It's also possible to implement your own components, such as mutators, fitness functions or crossover functions. Go to docs, to see more details.

Examples

Here are some examples of images generated with the tool and their CLI arguments.

sh franklin-cli --image "/temp/Lenna_(test_image).png" -t 7 -m Rectangle -f SquareDistance -c EqualHalfs --output-dir "/temp/images" --save-every 100

| Source image | Generated image (Generation #3000) | | :----------: | :-------------: | | Lenna<em>(test</em>image).png | example<em>1</em>3000.png |


sh franklin-cli --image "/temp/Lenna_(test_image).png" -t 7 -m Triangle -f SquareDistance -c ArithmeticAverage --output-dir "/temp/images" --save-every 100

| Source image | Generated image (Generation #4000) | | :----------: | :-------------: | | Lenna<em>(test</em>image).png | example<em>2</em>4000.png |


sh franklin-cli --image "/temp/Lenna_(test_image).png" -t 7 -m Rectangle -f SquareDistance -c ArithmeticAverage --output-dir "/temp/images" --save-every 100

| Source image | Generated image (Generation #13000) | | :----------: | :-------------: | | Lenna<em>(test</em>image).png | example<em>3</em>13000.png |


sh franklin-cli --image "/temp/Mona_Lisa_322_480.png" -t 7 -m Rectangle -f SquareDistance -c LeftOrRight --output-dir "/temp/images" --save-every 100

| Source image | Generated image (Generation #8000) | | :----------: | :-------------: | | Mona<em>Lisa</em>322<em>480.png | example</em>4_8000.png |


sh franklin-cli --image "/temp/Mona_Lisa_322_480.png" -t 7 -m Circle -f SquareDistance -c LeftOrRight --output-dir "/temp/images" --save-every 100

| Source image | Generated image (Generation #4000) | | :----------: | :-------------: | | Mona<em>Lisa</em>322<em>480.png | example</em>5_4000.png |


All examples above (without the source images) are licensed under CC BY-SA 4.0. For more details see asserts/README.md.

License

The source code is licensed under the MIT license, for more details see LICENSE.txt file.
All example images in asserts folder are licensed under CC BY-SA 4.0, for more details see asserts/LICENSE.txt file.