File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 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 `
You can’t perform that action at this time.
0 commit comments