Life is a Mystery

9 December 2008

Evolving Mona Lisa

Take semi-transparent polygons of this sort…

Picture 5.png

…and write an algorithm to arrange them so that they build up an imitation of another picture. If you could only use 50 polygons, how close could you get to Mona Lisa? Here’s how Roger Alsing approached the probelm with “genetic programming”:

I created a small program that keeps a string of DNA for polygon rendering.
The procedure of the program is quite simple:

0) Setup a random DNA string (application start)

1) Copy the current DNA sequence and mutate it slightly

2) Use the new DNA to render polygons onto a canvas

3) Compare the canvas to the source image

4) If the new painting looks more like the source image than the previous painting did, then overwrite the current DNA with the new DNA

5) repeat from 1

Take a look at his result, 904,314 generations later. More at Slashdot.

Comments are closed.

Eric Celeste / Saint Paul, Minnesota / 651.323.2009 / efc@clst.org