Here is an example for generating randomized background.
For good generation frames of ground must be tiled with each other.
<img src="http://s007.radikal.ru/i302/1201/ab/65a878945b6b.png" border="0">
<img src="http://s018.radikal.ru/i501/1201/82/c3e4f73acc23.png" border="0">
CAPX is here
P.S: Thanks to Yann.