Saturday, 13 October 2012

Blurring the truth, because lies tend to be prettier

I have been playing with my new RGB ants and this is my favourite image so far:


Apparently computerized ants bring out the arts student in me

I do though have to admit that I have rather cheated with this image. This is not pure output from the ants. When running my new code I quickly realised that the ants had a tendency to get into a temporary loop where they ran over a subset of cells for a period of time. This meant that the colour of these cells was very stark compared to the general blending which otherwise occurred. I solved this by applying a blender which compared each cell to its neighbours and if their difference was greater than some user-defined blur constant then it averaged the colour of the two cells and set both to that average. The blurring runs again and again until it carries out no more averaging. I have created a GIF to illustrate what effect this has:


At least it's a well blended murky grey...

As you can see, the blurring works but also tends to make the colour darker. I have listed the help of some computer scientists, and I will hopefully have a better blurring algorithm sorted out fairly soon. On the other hand the blurring tool has given me some ideas for other tools, like something to brighten up the image by adding a number to each RGB value of every cell or a contraster which increases the difference between coloured and non-coloured cells.

589793,

mathmo

No comments:

Post a Comment

About Me

I am a mathmo (mathematician for anyone not familiar with Cambridge slang) studying at the University of Cambridge, and this is the blog of my summer project on Langton's Ant. This project was dreamt up one evening in the college bar when I was showing some of the compscis (computer scientists) my old visual basic excel macros and stumbled across a very basic Langton's Ant. What I showed them was just one boring black ant. By the time I left the bar that morning I had progressed to two coloured ants colliding with each other, the demo macro that most of this project is built from. Through this project I hope to expand my knowledge of visual basic, encourage others to mess around with maths on their computers, and to make a lot of pretty pictures. I will aim to keep my language fairly non-technical, but feel free to comment if you have a question or even a suggestion on how to improve my code. Here it goes...