Skip to content

A genetic algorithm to try to re-create the Mona Lisa (adaptation of EvoLisa using Javascript)

License

Notifications You must be signed in to change notification settings

amnuts/EvoLisaJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EvoLisaJS

A swing at creating EvoLisa using Javascript.

EvoLisa is a program by Roger Johansson that uses genertic algorithms to recreate an image of the Mona Lisa using just polygons. The original .Net code can be found at https://rogerjohansson.blog/2008/12/07/genetic-programming-evolution-of-mona-lisa/

This version of it uses TypeScript and does things in a way that may only be compatible with the latest browsers. It was tested on the latest Chrome and Firefox and worked just fine. Your mileage may vary depending on what browser you use.

If you want to change the image, update the data-img attribute on the canvas tag in index.html.

Example output

After running for quite some time:

Example output

Get up and running

The main code is written using TypeScript, so you'll need to compile the source code in order to use it as plain javascript.

If you haven't already, install TypeScript using npm with the command:

npm install -g typescript

This will globally install the required TypeScript tools. You can then run the command:

tsc

to compile the TypeScript files into the dist directory where they will be ready for use by the browser. Then open up the index.html file in your browser. If you get CORS errors then you may find you need to start a small web server in order to run the index.html. I have PHP installed, so do php -S localhost:8080 -t . from the repo root and then go to http://localhost:8080/ in my browser.

About

A genetic algorithm to try to re-create the Mona Lisa (adaptation of EvoLisa using Javascript)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published