Giter VIP home page Giter VIP logo

stringart's Introduction

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.

stringart's People

Contributors

jblezoray avatar

Stargazers

Andres Petris avatar Melike Ateş Karayol avatar Minseong Kim avatar George Vilches avatar  avatar Rici86 avatar Jingjun avatar Siyuan Zhang avatar Arunachalam avatar  avatar  avatar Maxime Lebastard avatar

Watchers

 avatar

stringart's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.