"Genetic faces"

This project is in a way a pseudo genetic algorithm example. What is a genetic algorithm? In summary, a genetic algorithm is a process in which you can find the best "solution" for a given problem / requirement, by generating multiple sets of "candidates". These "candidates" can be assessed based on their fitness ( how well they match/ fulfill the requirements ). After each generation, the "best fitted" candidates have a higher likelihood of being selected and passing on their genes. Also after each generation, each new candidate has a chance of "mutating" some of the genes. This adds diversity and ensures that a given set of candidates can always end up with a completely different set of genes. In time, this process will generate the best matching examples. Although the utility of this process is not obvious, for more complex tasks where the solution cannot be intuitively obtained, this is one of the best.

An image is comprised of pixels. Each pixel is represented by a color and each color has 3 values that define it. The red, the green and the blue values. On the top there is a bar which shows how "accurate" on average the candidate images are, based on their pixel colors.

In this scenario, the task for the genetic algorithm is to find an image that matches as much as possible the top image. This is being done in stages. First it tries to find the best suited pixel colors from the "red" point of view. Then green, then blue. Every "frame", there are colors randomly being generated for every pixel in every bottom image. If the color is better suited than the current one, then in the new generation (frame) it will replace it. Gradually, the image becomes more and more accurate. Also you may notice that as the accuracy level progresses, it appears to slow down. That's because there is a smaller chance of "mutating" a better color, the closer you are to the best fitted values.