Crates.io | trifit |
lib.rs | trifit |
version | 0.4.0 |
source | src |
created_at | 2022-07-12 10:43:35.446185 |
updated_at | 2022-08-08 19:00:29.393419 |
description | Image compression and art generation with triangles! |
homepage | https://github.com/rowan-sl/trifit |
repository | https://github.com/rowan-sl/trifit |
max_upload_size | |
id | 624312 |
size | 1,129,168 |
Trifit takes input images like these
and give you beautefull triangle versions
and finally, it can create mindustry logic to display the images it creates --format mindustry
like so:
this can be used to get good looking logic images with VERY few processors (just make shure to use --image-size 176
or --image-size 80
)
note: schematics are not auto-generated, only code is. this will improve in the future
Trifit is a CLI program. to use, pass the path to the input image, and specify the size of the output image, the size of the starting triangle grid, the number of iterations, and the ammount to shift each vertex each step. for example:
trifit img/aroura_sky.jpg --image-size 900 --tri-size 15 --iterations 50 --shift 0.5
for more details about useage, run trifit --help
you can also specify a file to write the result to, and its format with --format
. available formats are svg
, image
(type determined by file extension), and mindustry
when outputing to the mindustry
format, it will produce multiple files if it gets too long. it will draw to the display1
output.
as the program runs, it will open a window to display its progress (it also helps aleviate boredom while the program runs). if this is not desierable, use --no-visuals
to disable this.
these affect what method is used to quantify how well a given triangle represents its part of an image, and can be specified with the --scoring
flag.
To build trifit from source, clone this repo and do cargo build
(or cargo build --release
). the binary will end up in ./target/debug|release/trifit
cargo install trifit
Contrbuting is appreciated, feel free to open an issue or pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE