begone-prop / voronoi

A multithreaded Voronoi diagram generator
GNU General Public License v3.0
1 stars 0 forks source link
gif imagemagick linux media mutlithreading png voronoi-diagram

A multithreaded Voronoi diagram generator

A still: showcase

An animation with 30 frames: showcase

Description

The following program generates an image or GIF file of a Voronoi diagram according to the parameters specified as arguments on the command line. It does this in a trivial manner, calculating the distance of each pixel to every anchor, although a more efficient algorithm exists. An even more efficient way could to be to calculate using a shader. If the -f, --frames options is specified a GIF file will be created where between each frame the anchors take a step in a random direction.

Usage

The only required option is the -o, --output_file when invoking the program. For the other unspecified arguments various default values be used. Example, voronoi --output_file diagram.png will create a 250x250 PNG file named diagram.png with 10 anchors at random positions with random colors chosen from a set of 60 random colors.

Options

The program takes various options that control the creation of the diagram.

Installation

The program can be compiled the following way:

git clone https://github.com/begone-prop/voronoi.git
cd voronoi
make

Dependencies

GNU Make
gcc
libpng
ImageMagick