Code Monkey home page Code Monkey logo

triangula-cli's Introduction

Triangula CLI

A CLI app which uses Triangula to generate triangulated images. For a simpler interface consider using the GUI.

Explanation of the algorithm

Running the algorithm saves a .json file every specified number of repetitions. This file contains data with the best set of the points from the algorithm. This file can then be rendered to a PNG or SVG.

Running

Run the algorithm using the command:

triangula run -img <path/to/your/image> -out <path/to/save/file>

For almost all cases, only changing the number of points and the shape type and leaving all other options with their default values will generate an optimal result.

To change the shape type use the flag:

-shape [triangles|polygons]

For a list of available options, run:

triangula run -help

Rendering

There are 2 image formats which the .json file can be rendered to: SVG and PNG. PNG is currently the only format that supports effects.

To change the shape type use the flag:

-shape [triangles|polygons]

SVG

Renders the .json file to a SVG.

Usage:

triangula render -in path/to/json -out path/to/save/svg

Options:

triangula render -help

PNG

Renders a .json file generated by the algorithm to a PNG. There are also multiple effects that can be applied to the output.

Usage:

triangula render -in path/to/json -out path/to/save/svg -img <path/to/your/image>

To add an effect, add the flag:

-effect [none|gradient|split]

Options:

triangula render -i . -o . -img . png -help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.