Thursday, December 11, 2008

Mona Lisa via genetic programming

[via Leisure Guy]

Roger Alsing writes on his blog:
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

Now to the interesting part :-)

Could you paint a replica of the Mona Lisa using only 50 semi transparent polygons?

That is the challenge I decided to put my application up to.

The image below is the result of that test:


Labels:

1 Comments:

Anonymous PO8 said...

This is really, really cool. Thanks for posting.

It isn't, technically speaking, genetic programming, though. It's what's known in academia as local search. Local search is cool because it is typically much, much faster to converge than "true" genetic programming, and is about as easy to program.

What a great demo!

December 11, 2008 5:35 PM  

Post a Comment

Links to this post:

Create a Link

<< Home