#cli #image #terminal #cgi #terminal-graphics #graphics #generative-art

bin+lib algoart

Algorithmic Art CLI: A Command-Line Tool for Creating Generative Art

2 releases

new 0.0.2 Jan 12, 2025
0.0.1 Dec 24, 2024

#77 in Graphics APIs

Download history 83/week @ 2024-12-18 53/week @ 2024-12-25 124/week @ 2025-01-08

260 downloads per month

MIT license

105KB
3K SLoC

algoart

Algoart

Build Status Codecov Latest Version Downloads Library Docs License: MIT Contributor Covenant

Machine Generated Art, is a rust crate and CLI application for generating algorithmic art.

Table of Contents

Install

Cargo

Note that you need to have the rust toolchain installed on your computer if you want to install algoart using cargo.

Algoart is distributed via crates.io and can be installed with:

cargo install algoart

If you'd like to install a specific version of algoart, use the --version flag:

cargo install --version $VERSION

If you have an old version of algoart already installed and wish to update it to the newest version, use the --force flag:

cargo install --force algoart

Check that algoart is successfully installed by running:

algoart -V

This should print algoart, followed by the version you have installed.

From Source

For development or if you would like to work with the latest, unstable version, you can install algoart from source. Note that you need to have the rust toolchain installed on your computer, if you want to build algoart from source. First, clone the algoart repository and enter it:

git clone https://github.com/obaraelijah/algoart && cd algoart

If you want to work inside this directory, potentially because you wish to contribute to algoart, you can execute the CLI application like this:

cargo run --release -- $FILE

$FILE being the path to the file containing your algorithms (see the

Example section). Note that adding the --release flag to the command significantly enhances the execution speed. You can also install Algoart from source, rather than just working from the source directory. Do so by running the following command in the Algoart source directory:

cargo install --path .

This will compile Algoart and make the program available for your user to execute directly from the command line.

Check installation by running:

algoart -V

Example

If you run algoart -h, you will find that algoart takes a single file as input argument. The content of the file contains the configuration for the art pieces you wish to generate. Currently, Algoart supports Json and Jsonnet input files. The input file contains an array of algorithm objects where each one describes an artwork you would like to create. This is an example Json file that would generate a single artwork, a rendering of a buddhabrot:

[
   {
      "algorithm": "buddhabrot",
      "filename": "buddhabrot_20000.png",
      "width": 3800,
      "height": 2000,
      "center": {
         "im": -0.35,
         "re": 0
      },
      "zoom": 0.45,
      "exponent": 2,
      "iter": 20000,
      "rotation": 90,
      "sample_count": 500000000,
      "sampler": {
         "r": 3,
         "type": "uniform_polar"
      },
      "post_processing": [
         {
            "process": "normalize"
         },
         {
            "bin_count": 256,
            "contrast_limit": 500,
            "process": "clahe",
            "tile_size_x": 380,
            "tile_size_y": 200
         },
         {
            "h": 0.0005,
            "n": 7,
            "process": "smoothing",
            "type": "non_local_means",
            "window_size": 21
         }
      ],
      "color_map": {
         "gradient": {
            "factor": 1,
            "type": "linear"
         },
         "map": [
            {
               "b": 0,
               "g": 0,
               "r": 0,
               "type": "rgb"
            },
            {
               "b": 255,
               "g": 255,
               "r": 255,
               "type": "rgb"
            }
         ]
      }
   }
]

You simply run algoart $FILE and Algoart does the rest for you. The resulting image looks like:

Buddhabrot

You can find more example artworks and their configuration in the examples/ folder here.

Supported Algorithms

Below you will find a list of algorithms either already supported by Algoart or planned to be supported in a future release.

Fractals

Algorithms for creating various types of fractal art.

Mandelbrot and Julia Sets

Buddhabrot

  • Buddhabrot

  • Anti-Buddhabrot

  • Nebulabrot

Other

  • Fractal Flames

  • Newton Fractals

  • Strange Attractors

  • L-Systems

AI Art

  • DeepDream-like filter

  • Text-to-image

Contributing

Contributions are very welcome! See CONTRIBUTING.md for details. When you contribute, make sure to follow the Contributor Covenant v2.1.

License

Algoart is licensed under the MIT license. See LICENSE for details.

Dependencies

~9MB
~173K SLoC