[Download postscript version]
next up previous
Next: Application Up: Hash Visualization: a New Previous: Requirements for Hash Visualization

Random Art: A Prototype Solution

   

In this section, we propose Random Artas a prototype solution for the hash visualization algorithm. Random Artwas developed by Andrej Bauer, and is based on an idea of genetic art by Michael Witbrock and John Mount. Originally Random Artwas conceived for automatic generation of artistic images. A brief overview and demonstration of Random Artcan be found at Andrej's Random Artweb site [4].

The basic idea is to use a binary string s as a seed for a random number generator. The randomness is used to construct a random expression which describes a function generating the image--mapping each image pixel to a color value. The pixel coordinates range continuously from -1 to 1, in both x and y dimensions. The image resolution defines the sampling rate of the continuous image. For example, to generate a 100 100 image, we sample the function at 10000 locations.

Random Artis an algorithm such that given a bit-string as input, it will generate a function F: [-1,1]2 →[-1,1]3, which defines an image. The bit-string input is used as a seed for the pseudo-random number generator, and the function is constructed by choosing rules from a grammar depending on the value of the pseudo-random number generator. The function F maps each pixel (x,y) to a RGB value (r,g,b) which is a triple of intensities for the red, green and blue values, respectively. For example, the expression F(x,y) = (x, x, x) produces a horizontal gray grade, as shown in figure 2(a). A more complicated example is the following expression, which is shown in figure 2(b).

 
imagemark>#split178#

   figure187
Figure 2: Examples of images and corresponding expressions.

The function F can also be seen as an expression tree, which is generated using a grammar G and a depth parameter d, which specifies the minimum depth of the expression tree that is generated. The grammar G defines the structure of the expression trees. It is a version of a context-free grammar, in which alternatives are labeled with probabilities. In addition, it is assumed that if the first alternative in the rule is followed repeatedly, a terminal clause is reached. This condition is needed when the algorithm needs to terminate the generation of a branch. For illustration, consider the following simple grammar:
align199

The numbers in supscripts are the probabilities with which alternatives are chosen by the algorithm. There are three rules in this simple grammar. The rule E specifies that an expression is a triple of compound expression C. The rule C says that every compound expression C is an atomic expression A with probability {14}, or either the function add or mult applied to two compound expressions, with probabilities {38} for each function. An atomic expression A is either a constant, which is generated as a pseudorandom floating point number, or one of the coordinates x or y. All functions appearing in the Random Artalgorithm are scaled so that they map the interval [-1,1] to the interval [-1,1]. This condition ensures that all randomly generated expression trees are valid. For example, the scaling for the add function is achieved by defining add(x,y) = (x+y)/2.

The grammar used in the Random Artimplementation is too large to be shown in this paper. Other functions included are: sin, cos, exp, square root, division, mix. The function mix(a,b,c,d) is a function which blends expressions c and d depending on the parameters a and b. We show an example of an expression tree of depth 5 in figure 3, along with the corresponding image. For the other images in this paper, we used a depth of 12.

    figure229
Figure 3: Random Artexpression tree and the corresponding image


next up previous
Next: Application Up: Hash Visualization: a New Previous: Requirements for Hash Visualization

Adrian Perrig
Wed Sep 15 15:31:30 PDT 1999