Skip to main content

EvoLisa - My own version

It's an old idea by now, can we recreate the Mona Lisa with fifty polygons by using random changes? The idea and original implementation by Roger Johansson can be found here.

So, how does it work? You start with an source image. Then you create an empty image. We keep on doing small changes to this image. In my case this is one of these changes:
  • Recolor our polygon
  • Change the position of one of the polygon points
  • Add or remove a new point to our polygon
  • Add or remove a new polygon
  • Switch two polygons

After each action, we take a look and check if the newly changed image looks more like the original image by comparing each pixel. If it is, we continue using this one. If it's not, we discard the changes.

Looks like a fun project! So I built my own version from scratch eight years ago, reusing some of the same ideas. Here's my result using the Mona Lisa:

Mona Lisa with 50 polygons:

You can see that it's the Mona Lisa but the details around the eyes and mouth are really missing.

Mona Lisa with 200 polygons:

Ah, that looks a lot more like it!
And now I want to pick it up again and make some improvements! Let's see what we can do...

Comments

Post a Comment

Popular posts from this blog

EvoLisa - Comparing two images: performance tuning

It looks like the program is rather slow. Using DotTrace , I took a look at where the bottleneck is. The method that calculates the 'fitnesse', how closely the created image resembles the original image, is where most of the time goes to. Can we improve that? So what happens in this function? We compare each pixel of both images to compare their ARGB values. The better they match, the better the result! How can be compare this? First, I tried using the naive approach: compare each pixel using a bitmaps GetPixel(x, y) . Do that however, and you'll quickly see how excruciatingly slow that is. Especially considering that even with an image of 333x333 you're already comparing a million pixels each time you compare two images! So, instead I tried using a 'FastBitmap'. It's a project I found which wraps the Bitmap and provides much faster Get and SetPixel performance. Using this instead, the performance went up by an order of magnitude! But we can still do be

Welcome back

Seeing my World of Warcraft account getting hacked wasn't much fun but it does have one positive side. Since I had to pay €15 to get my deleted items back I decided to log in a few times this month and see what changed. I haven't played WoW since April this year so there's quite a bit of new content to go through. And of course I wanted to say hello again to all the friends I haven't spoken to in months. As I logged in I was quickly greeted by some of my guild members. Time is never standing still so I wasn't surprised to see that my guild looks nothing like it did half a year ago. Roughly half of the people I enjoyed chatting and playing with had all decided to join a guild that was more to their liking. Only the officer team seems to be relatively intact. The player gap has been filled in with lots of new players but it doesn't feel like the same guild. I had a chat with the old officers and my friends from ancient times. In this short time I even got a few