Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anthonynguyen/primitive
Approximates images by drawing random lines
https://github.com/anthonynguyen/primitive
approximation image rust
Last synced: 25 days ago
JSON representation
Approximates images by drawing random lines
- Host: GitHub
- URL: https://github.com/anthonynguyen/primitive
- Owner: anthonynguyen
- License: mit
- Created: 2017-10-13T16:31:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-18T03:55:21.000Z (about 7 years ago)
- Last Synced: 2024-11-28T13:11:40.987Z (about 1 month ago)
- Topics: approximation, image, rust
- Language: Rust
- Homepage: https://crates.io/crates/primitive
- Size: 3.02 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `primitive`
[![primitive on Travis CI][travis-image]][travis]
[![primitive on crates.io][cratesio-image]][cratesio]
[![primitive license][license-image]][license][travis-image]: https://travis-ci.org/anthonynguyen/primitive.svg?branch=master
[travis]: https://travis-ci.org/anthonynguyen/primitive
[cratesio-image]: https://img.shields.io/crates/v/primitive.svg
[cratesio]: https://crates.io/crates/primitive
[license-image]: https://img.shields.io/github/license/anthonynguyen/primitive.svg
[license]: https://github.com/anthonynguyen/primitive/blob/master/LICENSEprimitive is a Rust program that approximates images by drawing random lines.
## Installing
Assuming you have Rust installed, run
```
cargo install primitive
```Alternatively, you can run it from the source directory with
```
cargo run --release -- ...OPTIONS...
```## Samples
**********
[Source](https://www.pexels.com/photo/high-angle-view-of-cityscape-against-cloudy-sky-313782/)
![sample 1 input](sample/sample1_input.png)
![sample 1 output](sample/sample1_output.png)
```
primitive -i sample/sample1_input.png -o sample/sample1_output.png -n 10000000 -l 10
```**********
[Source](https://www.pexels.com/photo/autumn-daylight-fall-fog-589841/)
![sample 2 input](sample/sample2_input.png)
![sample 2 output](sample/sample2_output.png)
```
primitive -i sample/sample2_input.png -o sample/sample2_output.png -n 1000000 -l 40 --min-angle 20 --max-angle 60
```## Usage
```
primitive 0.1.0
Anthony NguyenUSAGE:
primitive [OPTIONS] --input [SUBCOMMAND]FLAGS:
-h, --help Prints help information
-V, --version Prints version informationOPTIONS:
-i, --input Input filename
-n, --iterations Number of iterations to run [default: 1000000]
-l, --line-length The length (in pixels) of the lines to draw [default: 25]
--max-angle The maximum angle (in degrees) to generate [default: 360]
--min-angle The minimum angle (in degrees) to generate [default: 0]
-o, --output Output filenameSUBCOMMANDS:
bench Runs in benchmark mode
help Prints this message or the help of the given subcommand(s)
```## License
`primitive` is licensed under the MIT license. Please see the `LICENSE` file for
more details.