Work in progress.
This project generates string art versions of any image.
Feed it an image, and it will re-create it with a single string connected to nails.
Install maven >=3.6.2 and a java jdk >=11. Compile with:
$ mvn package
This generates a standalone command line application in cli/target/stringart.jar
:
$ java -jar cli/target/stringart.jar --help
Usage:
java -jar <jar_file> [flags] [options] <goal image>
Arguments:
<goal image> The goal image.
Flags:
-help, -h print help
-quiet, -q Quiet mode
-disableEdgeWay disables the rendering of the way the string goes around edges. Enables a
~4x faster rendering, but is less precise.
Options:
-importanceImage, -i An importance image, that ponderates the pixels of the goal image
-output, -o Output file for rendering the graphical result
-diff, -d Output file for a pixel to pixel difference between the rendering and the
goal image
-stringPath, -s Output file for saving the string path
To run it on the sample files included in the project, use this command. It will run for 1 or 2 hours to generate the final result.
$ java -jar cli/target/stringart.jar \
samples/einstein/goal_image.png \
-i samples/einstein/importance_image.png
This project has had many inspiration sources:
The original idea came from Greek artist Petros Vrellis in 2016.
Vrellis idea was latter refined in 2018 by Michael Birsak et al. They proposed a "method for the automatic computation and digital fabrication of artistic string images" [1] (Matlab sources). When I began this project, I tried to implement an alternative implementation based on Genetic algorithms, but I ultimately failed and had to retreat to the amazing Birsak proposition.
[1] Michael Birsak et al. "String Art: Towards Computational Fabrication of String Images", Computer Graphics Forum (Proc. EUROGRAPHICS 2018), 37(2), April 2018.
Many other implentations are available on the internet:
- Knit, in C++, as part of a master thesis project;
- Strixel, in C++ with a GUI;
- Knitter, in Processing, by Christian Siegel;
- ThreadTone, in Python;
- Automate the art, also in Processing, is a project that appears on hackaday.io;
- A string art font by Erik Demaine;
- Mid-air Laser Image Display is a somehow similar project that appears on hackaday, but it relies on lasers instead of strings.