A Rust library and a CLI tool to transform your pictures into String Art 🧵 This is a Rust rewriting of a project i did for school.
|
|
3 maanden geleden | |
|---|---|---|
| images | 3 maanden geleden | |
| src | 3 maanden geleden | |
| .gitignore | 3 maanden geleden | |
| Cargo.lock | 3 maanden geleden | |
| Cargo.toml | 3 maanden geleden | |
| LICENSE | 3 maanden geleden | |
| README.md | 3 maanden geleden |
A Rust library and a CLI tool to transform your pictures into String Art 🧵 This is a Rust rewriting of a project i did for school (documentation in french 🥖).
⚠️ This crate is not published yet, this guide is not working at the moment ⚠️
To use the library, you need to add it to your project using cargo with this command :
cargo add p2sa
You can now call the p2sa function :
use p2sa::p2sa;
fn main() {
p2sa("path/to/your/picture.png".to_string(), "path/to/your/result.png".to_string(), [1024, 1024], 400);
}
The nails are randomly placed on the edges of the shapes. The program starts on the first nail of the list, and simulates the reduction of the difference between the original image and the working image. It chooses the line that reduces the difference the most, and repeat this steps until the error increase 3 times in a row.
For more details, you can check the wiki page of my school project. It's in french but may be translated.
This crate relies heavily on the rust crates image and edge-detection.