Skip to content
/ ToLego Public

Turns common picture into lego brick picture

Notifications You must be signed in to change notification settings

Loshido/ToLego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToLego

A simplistic cli tool that transforms your pictures into lego brick pictures made with rust using the image lib.

Default vs bricked Default vs bricked

Steps

  1. computes the average color of the brick by passing through each pixels of the brick;

  2. multiplies by the brick pixel (allows to tend to black when the brick pixel tends to black otherwise it keeps the average color).

  3. saves the image to path/to/file.lego for optimization

  4. optimizes the lego file and saves to path/to/file.lego.png using oxipng

Usage

the brick.jpg need to be in the same directory as the executable

  • ToLego.exe -f path/to/picture -> default bricksize (50px / 50px)
  • ToLego.exe -f path/to/picture -b 100 -> bricksize of 100px / 100px

Setup

Install

cargo install

Build

cargo build --target-dir dist

Debug

cargo run -- -f path/to/file -b 25

About

Turns common picture into lego brick picture

Topics

Resources

Stars

Watchers

Forks

Languages