Saturday, October 30, 2010

Evolving Wallpaper for Ubuntu

Id been planning on learning image processing in python (or rather, using PIL, numpy and scipy) and so when I saw this, it was the perfect opportunity. I have forever been fascinated with cellular automata and in particular, Conway's Game of Life. Though I was never a fan of biology in school, there was always something hypnotic about watching bacteria multiply. So for my implementation, instead of a randomness, the evolution follows the rules of Conway's Game of Life.
For the uninitiated, cellular automata, is like a simulation of simple life forms. You have rules for growth, survival and decay. Conway's Game of Life is a form of cellular automata based on four simple rules:
  1. Any live cell with less than two live neighbours dies (as if by under-population).
  2. Any live cell with more than three live neighbours dies (as if by over-population).
  3. Any dead cell with exactly three live neighbours becomes a live cell (as if by reproduction).
  4. Any live cell with two or three neighbours lives on with no change in state.
You can find the code here: Game of Life Wallpaper. Its a simple python scrpt that takes an initial cell configuration stored as an lif 1life.06 file, generates image s based on other confgurations you can enter in the config.py file, and finally generates an XML that you can then set in Ubuntu as your wallpaper. The code is very rough, it is my first experiment with scipy, numpy or PIL so things may be done very inefficiently. I would love comments or suggestions. I would especially appreciate if anyone could tell me how to filter the image to make the colour gradiations look better.
A sample of a generated wallpaper:


I learnt quite a few interesting things working on this script. Most surprising was the amount of time people have spent on this. There is a wiki, which boasts a collection of about 600+ interesting patterns. There are about 6 file formats used to save cell configurations. People have written implementations in java, javascript, HTML5, and probably any other language you can write code in, I think its been implemented.

Notes:
The code for the Game of Life implementation was taken from here.

4 comments:

  1. alia bhatt photos
    Find All latest bollywood news,Bollywood Wallpapers,Bollywood Hot and latest Gossips only on bollywoodjosh.com - .

    ReplyDelete
  2. Bandar Slot Pragmatic Play 2021 메리트카지노 메리트카지노 메리트 카지노 주소 메리트 카지노 주소 423Chocolates for sale near me

    ReplyDelete
  3. Best Bitcoin slots casino (2021) | JamBase
    The best casino game is played on 수원 출장마사지 slots. A simple play can be a great option for the players of งานออนไลน์ this 군산 출장샵 slot machine because of its simplicity 여주 출장샵 and the possibility 김천 출장마사지 to

    ReplyDelete
  4. But achieving the break-even point would be powerful as Korea permits only foreign passport holders to enter casinos. Paradise strategically formed a partnership with Sega Sammy, which focuses on growing amusement and entertainment content, to offer visitors more than only a on line casino, officers stated. 카지노 The firm, established in 2012, is a method partnership} between South Korean on line casino operator Paradise Group and Japanese entertainment firm Sega Sammy.

    ReplyDelete