https://github.com/spejamchr/string_art
Transform an image into string art
https://github.com/spejamchr/string_art
art string-art
Last synced: 8 months ago
JSON representation
Transform an image into string art
- Host: GitHub
- URL: https://github.com/spejamchr/string_art
- Owner: spejamchr
- License: mit
- Created: 2021-04-04T15:57:24.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T17:31:49.000Z (over 2 years ago)
- Last Synced: 2024-04-24T04:27:08.526Z (about 2 years ago)
- Topics: art, string-art
- Language: Rust
- Homepage:
- Size: 42.1 MB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# string_art
> Transform an image into string art
## Installation
```bash
git clone https://github.com/spejamchr/string_art
cd string_art
cargo build --release
```
The binary will be at `./target/release/string_art`.
## Usage
```bash
string_art --input-filepath --output-filepath [FLAGS] [OPTIONS]
```
Use `--help` or `-h` to see the full usage.
## Examples
### Grayscale: White String on Black Background
```bash
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.
```bash
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
```bash
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
```