DianaXiong / string-art

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

String art

Tool calculating how to recreate an input image as string art, that is, by arranging a single line of thread wound around a circle of nails.

Inspired by this video:

String art

Usage:

python strings.py input-image.png output-prefix

The input image should be square-shaped.

The output is in output-prefix.png. There are two extra files showing intermediary steps of the computation: output-prefix-allow-negative.png shows the string art when both black and white strings are allowed. output-prefix-unquantized.png shows the string art when infinitely thin and long threads are allowed (but only white).

Example output:

Image with allow-negative:

Trump allow-negative

Image unquantized:

Trump unquantized

Final image, created from ~12000 arcs. Assuming a circle of diameter 1 meter, this is ~10 kilometers of thread:

Trump final

Don't try to be too cheap with the strings:

Bellucci, 15 quantization levels Bellucci, 5 quantization levels

About


Languages

Language:Python 100.0%