Skip to content

jblezoray/stringart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stringart Build Status Coverage Status

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.

goal imagesample output

goal imagesample output

Usage

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

Related works

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:

TODO list

  • a GUI.
  • CLI: show default values in the help.
  • CLI: add a possibility to use a text string path file as a start point.
  • CORE: before the upscaling step, run a genetic algo for avoiding local optimums. (see 1, 2)
  • CORE: use GPUs if any.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages