Created: 2008-12-22 03:00
Updated: 2017-04-17 08:11
License: other



GeneticLeonardo is a program that "evolves" drawings. The chromosomes encode the position, shape and color of 50 polygons. The fittest chromosomes are those who produce images most like a given image.

The goal is to approximate any image with only 50 polygons.

Here's how it works:

  1. Generate a random population of chromosomes

  2. Produce images by interpreting these chromosomes

  3. Select the chromosomes that produce the best images

  4. Mate the best chromosomes by exchanging information

  5. Mutate the new chromosomes slightly

  6. Kill the worst ranked chromosomes

  7. Repeat from step 2 until satisfied


An executable version can be downloaded from:


You are more than welcome to contribute to this project! There is room for a lot of improvement.

Source code

The code is released as Open Source under the BSD license.

A zip of the source code is available at:

A zip of an earlier version which uses Genetic Programming is available too:

Note that the GP version doesn't converge very well yet.

Source guide

The most important classes are:


Cool hu?

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more