Skip to content

Latest commit

 

History

History
53 lines (26 loc) · 1.43 KB

README.md

File metadata and controls

53 lines (26 loc) · 1.43 KB

Genetic algorithm - Monalisa

From an image you can create the same image but formed of polygons.

You can do it in 2 ways, one with genetic algorithm, the other directly.

Guide step-by-step

Setup

To install the requirements:

sudo pip install -r requirements.txt

Genetic algorithm

Use the file giwga.py like this:

python giwga.py --population 1000 --dimension 30 --img="Image/monalisa.jpg"

For more info run python giwga.py

In Runtime

It will create an image, called pic.png, that is the representation in polygons of the original image

Also it will be open in the browser, that automatically refresh the image.

With Genetic algorithm it will take a lot of time to make and image similar to the original so Use very small image

Image to Polygons

Use the file giwga.py like this:

python giwp.py --number-polygons 1000 --dimension 30 --img="Image/monalisa.jpg"

For more info run python giwp.py

Results

Original image

Generated image with 50000 polygons of dimension 30

Generated image with 10000 polygons of dimension 70