Skip to content

Commit 647ef19

Browse files
committed
presentation
1 parent 9ad2cf4 commit 647ef19

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# ToLego
2+
A simplistic cli tool that transforms your pictures into lego brick pictures made with rust using the [image](https://crates.io/crates/image) lib.
3+
4+
![Default vs bricked](demo.png)
5+
6+
# Steps
7+
8+
1. computes the average color of the brick by passing through each pixels of the brick;
9+
10+
2. multiplies by the brick pixel (allows to tend to black when the brick pixel tends to black otherwise it keeps the average color).
11+
12+
3. saves the image to path/to/file.lego for optimization
13+
14+
4. optimizes the lego file and saves to path/to/file.lego.png using [oxipng](https://github.com/shssoichiro/oxipng)
15+
16+
# Usage
17+
18+
the brick.jpg need to be in the same directory as the executable
19+
20+
- `ToLego.exe -f path/to/picture` -> default bricksize (50px / 50px)
21+
- `ToLego.exe -f path/to/picture -b 100` -> bricksize of 100px / 100px
22+
23+
# Setup
24+
25+
## Install
26+
27+
`cargo install`
28+
29+
## Build
30+
31+
`cargo build --target-dir dist`
32+
33+
## Debug
34+
35+
`cargo run -- -f path/to/file -b 25`

demo.png

1.27 MB
Loading

0 commit comments

Comments
 (0)