Skip to content

Uses some AI tools to split an image into simple triangles.

Notifications You must be signed in to change notification settings

falahat/splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Splitter

This let's you split an image into low-res triangles. It uses some basic AI tools to break up the image in the most optimal places so that we reproduce the original image as best as possible. It tries to minimize the average color "distance" between the actual color of a pixel and the color of the triangle that covers it. Less difference is better.

Examples

Most of these use the simpleai library's local search functions to find a near optimal solution. However, the solutions aren't really that good yet.

Alt text Alt text Alt text Alt text

Alt text Alt text

Alt text Alt text

Usage

Use python main.py with the following command line uptions:

  • -i, --infile : The filepath to the input image
  • -o, --outfile : The filepath to the output image. Not yet implemented.
  • -m, --method : The search method to use to find a solution. The default is hill climbing with random seeding. The following methods are implemented:
    • astar : astar search
    • beam : beam search
    • hill_random : hill climbing with random seeding
    • hill : hill climbing
  • -w, --wait : After processing the image, it will give you the chance to run further improvements on it and adjust settings.
  • -n, --maxpoints : The maximum amount of polygon points to allow the algorithm.

So here's an example:

python main.py -i images/panda-sm.png -w -n 8 -m hill_random

About

Uses some AI tools to split an image into simple triangles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages