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 built procedural_wallpapers binary with the --help flag.

Command-Line options

> cargo run --release --package procedural_wallpapers -- --help

Procedural Wallpapers Generator - CLI tool

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

Options:
  -m, --mode <MODE>      Image generation mode [possible values: clouds, flow, islands, lightning, nearestpoint, tangles, cellularone, squares, squareshor, squaresver, squaresdiag, squares2, squares2h, squares2v, nearestgradient]
  -w, --width <WIDTH>    Desired width (pixels) of the generated image [default: 1920]
  -h, --height <HEIGHT>  Desired height (pixels) of the generated image [default: 1080]
  -s, --seed <SEED>      Seed for the random number generator. If a seed of 0 is given, no seed is used [default: 0]
  -o, --output <OUTPUT>  The output file to save
      --help             Open the command-line help
  -V, --version          Print version

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.

Pattern

A fixed pattern is repeated over the complete image

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

Contributors 2

  •  
  •