new site: jlongster.com

posted in Programmology
Published May 26, 2009
Advertisement
I just launched http://jlongster.com/. I will be actively posting projects and blog entries related to 2d/3d graphics development, and hopefully game programming. I'm a Scheme programmer, so a lot of it will concerning Scheme. You might be interested in stuff there though.

Instead of canceling GDNet+, I'm going to try copying my blog posts here. I think this is a good community and I hope some of you keep track of my work. I will soon be working part-time on high-performance graphics work in Scheme.

To kick it off, here's one of my first blog entries:

-----------------------------------------------------

http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/

Mona Lisa genetically drawn from Scheme

May 25, 2009

Remember the inspiring project which drew Mona Lisa using a genetic algorithm (or, according to some people, stochastic hill climbing)? I decided to implement this technique in Scheme. I've always been fascinated by genetic algorithms and this is a good project to learn them.

I call the project "Genetic Canvas" (github). It is written in Gambit Scheme on OS X and uses OpenGL.

I explored various methods of helping the genetic algorithm, from edge detection to color analysis. In the end, most of this work ended up hurting its ability to solve the problem. The basic process uses a population size of 10, randomly creates and mutates polygons on the screen, and analyzes each solution by summing the color difference of each pixel. We then use elitist selection to pick the best one, and rinse and repeat.

There were points in the project which I felt hatred towards genetic algorithms. I underestimated the flaky and irrational behavior of the whole process, which is something close to a temperamental child. All of your mutation rates, population sizes, mutation and fitness procedures, etc. have to be exactly right, and there's no way to provably solve which settings are correct. You have to eye the solution yourself and tweak the settings as you see fit.

In the end, I still find genetic algorithms interesting. This application of them is simply not very interesting, as it has no practical use, and the problem set is rather difficult to solve generally (large and small images, various compositions, etc.).

I wanted it to find an acceptable solution quickly. The following images were rendered in about 30 minutes.




With borders...



And finally, taking about 3 hours...

0 likes 2 comments

Comments

zedz
wow never heard about this before, but thats very nice, good to see someone do something a bit diiferent in the graphics field
May 26, 2009 05:26 PM
okonomiyaki
Thanks. I was inspired by the original implementation. It's always fun to write a small program to test a theory.
May 27, 2009 12:18 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement