GithubHelp home page GithubHelp logo

aail-art's Introduction

AAIL-Art

Abstract Art Involving Lines (AAIL)

Create art using computer science. This will initially be line diagrams using the Travelling Salesman Problem (TSP).

For the initial version, only Prim's algorithm is used. Whilst this results in a Minimum Spanning Tree (MST) and not a TSP, the resulting images can still be pleasing. This implementation of Prim's algorithm is also O(n^2) and will not scale well for large inputs. For tuning, use the simplify command line option.

Finally, the solver allows for use of two different distance calculators: L1 and L2. L1 distance is commonly known as Manhattan distance and is the distance it'd take you to get from one point to another if you had to navigate via city blocks. L2 distance can be described as the distance 'as the crow flies'. Manhattan distance encourages horizontal and vertical lines which may serve a particular aesthetic aim.

Usage: aail [options] input_image output_image

Options:
  -h, --help   show this help message and exit
  -n SIMPLIFY  Simplification amount (retain 1/n vertices for MST)
  --l1         Enable L1 (abs(x) + abs(y)) distance calculation instead of L2
               (x**2 + y**2)

If you were crazy...

If you want to contribute to this pet project, some ideas include:

  • Find the most common k colours and perform one MST / TSP per colour, combining them together to form the image
  • Implement approximate TSP (non overlapping for aesthetics) so you can trace the image without taking your pen off the paper
  • A C/Go/Java/Lua/PyPy/NumPy/GPGPU//... implementation of MST for improved speed on large data sets
  • For the "I must make everything a ray tracer" idea: store the pixels in an octree so only a subset of pixels need to be considered instead of all N pixels

aail-art's People

Contributors

smerity avatar

Watchers

 avatar  avatar

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.