Skip to content

lukas-kirschner/procedural-wallpapers-rs

Repository files navigation

procedural-wallpapers in Rust

A collection of wallpaper generators. Based on a fork of bagyonis procedural wallpapers project in C++ (link). Rewritten in Rust.

How to use

  1. Set up your Rust toolchain with Cargo
  2. Clone this repository
  3. Build the project by typing cargo build --release
  4. To get command-line help, run the build binary with the --help flag.

Command-Line options

procedural_wallpapers 0.1.0
Generate wallpapers procedurally with the given algorithm

USAGE:
    procedural_wallpapers [OPTIONS] --mode <MODE> --output <OUTPUT>

OPTIONS:
    -h, --height <HEIGHT>    Desired height (pixels) of the generated image [default: 1080]
        --help               Print help information
    -m, --mode <MODE>        Image generation mode [possible values: clouds]
    -o, --output <OUTPUT>    The output file to save
    -s, --seed <SEED>        Seed for the random number generator. If a seed of 0 is given, no seed
                             is used [default: 0]
    -V, --version            Print version information
    -w, --width <WIDTH>      Desired width (pixels) of the generated image [default: 1920]

Generators and examples

All the example images shown below were generated with a size of 400x400 pixels and a seed of 123456. They can be automatically re-generated by running make thumbnails in the project directory.

Clouds

Perlin noise fed into a sigmoid function.

Flow

Perlin flow field.

Islands

Perlin noise fed into a cutoff function.

Lightning

Similar to a Brownian tree but faster to generate.

Nearest-Point

Each Pixel gets the color of its nearest point neighbor.

Tangles

Rec-tangles.

Nearest-Gradient

Each Pixel gets colored with a gradient to its nearest-point-neighbors.

Cellular One

Each pixel is colored based on a cellular automaton that colors each pixel according to the average value of each neighbor color, starting with random pixels at random locations.

Squares

The algorithm starts in the upper left corner of the image, coloring a square in a random color. Then, each pixel, from left-to-right, top-to-bottom gets assigned the average color of neighboring pixels plus a random offset.

Horizontal Squares (SquaresHor)

The Squares algorithm, prioritizing squares that are located above each pixel

Vertical Squares (SquaresVer)

The Squares algorithm, prioritizing squares that are located left of each pixel

Diagonal Squares (SquaresDiag)

The Squares algorithm, prioritizing squares that are located above left of each pixel

Squares with random pixels (Squares2)

The Squares algorithm, with more initial pixels that have a random color assigned in the middle of the image

Horizontal Squares with Random Pixels

The Squares algorithm, prioritizing squares that are located left of each pixel, with randomized pixels in the image

Vertical Squares with random pixels (Squares2)

The Vertical Squares algorithm, with initial pixels that have a random color assigned in the middle of the image

About

Procedural Wallpapers - Re-Implementation in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published