Skip to content

spejamchr/string_art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String art rendering of an elephant

string_art

Transform an image into string art

Installation

git clone https://github.com/spejamchr/string_art
cd string_art
cargo build --release

The binary will be at ./target/release/string_art.

Usage

string_art --input-filepath <FILEPATH> --output-filepath <FILEPATH> [FLAGS] [OPTIONS]

Use --help or -h to see the full usage.

Examples

Grayscale: White String on Black Background

Reference photo of red yarn on skein String art rendering in white string on a black background of yarn on skein

string_art \
    --input-filepath ./examples/fiber.jpg \
    --output-filepath ./examples/fiber-string-wob.jpg \
    --data-filepath ./examples/fiber-string-wob.json \
    --pin-arrangement perimeter \
    --pin-count 300 \
    --step-size 0.5 \
    --string-alpha 0.1 \
    --max-strings 2300 \
    --verbose --verbose

Splash of Color: White & Red String on Black Background

This also uses the --gif-filepath options to create a GIF of the creation process.

Reference photo of red yarn on skein String art rendering in red & white string on a black background of yarn on skein Animation of string art construction

string_art \
    --input-filepath ./examples/fiber.jpg \
    --output-filepath ./examples/fiber-string-color.jpg \
    --data-filepath ./examples/fiber-string-color.json \
    --gif-filepath ./examples/fiber-string-color.gif \
    --pin-arrangement circle \
    --pin-count 300 \
    --step-size 0.5 \
    --string-alpha 0.1 \
    --foreground-color '#FFFFFF' \
    --foreground-color '#FF0000' \
    --max-strings 2600 \
    --verbose --verbose

The Elephant: Auto-pick the colors

string_art \
    --input-filepath ./examples/elephant.jpg \
    --output-filepath ./examples/elephant-string.jpg \
    --data-filepath ./examples/elephant.json \
    --pin-arrangement circle \
    --pin-count 400 \
    --step-size 0.5 \
    --string-alpha 0.1 \
    -u 3 \
    --verbose --verbose

About

Transform an image into string art

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published