jeudi 4 juin 2009

Piling hexagons

As I tried to explain here, all of my images are constructed by piling simple patterns. Piling patterns is a truely addictive activity. It's impossible to predict what you will get and, provided the pattern is simple enough, the result is bound to be esthetically pleasant. Consider for instance the hexagonal tiling by black and brownish hexagons shown below.

The hexagons are colored such that around each vertice of the tiling, there are always two black hexagons and a brown one. Such a coloring is called Archimedean. For those understanding these words, this coloring is even uniform, because the symmetry group of the colored tiling acts transitively on the vertices. Anyway, it is a desperately simple pattern. Let us see what happen when we pile several copies of it, each copy being three times smaller than the previous one. Adding three copies, we get these nice shapes.

Going on and adding enough copies so that the smallest ones cannot be distinguished anymore, we get this :

Among other things, one can spot Koch snowflakes ! Even better, a closer look reveals a tiling of the plane by Koch snowflakes. Actually, the procedure consisting of removing from the plane the (open) brown hexagons from each copies of the tiling results in a fractal subset of the plane (pictured in black in the image above) which is the boundary of the tiling of the plane by the Koch snowflakes. There are many tilings by Koch Snowflakes (see for instance here), but I counldn't find this one... I would guess that the boundary of this tiling can be generated as an iterated function system. Anyway, here is a polished image to explore.

mardi 2 juin 2009

dimanche 24 mai 2009

dimanche 17 mai 2009

samedi 16 mai 2009

The "brick-and-mortar" museum of computer art

If you live in the New York area, you should pay a visit to the MOCA. I went there today and it was great to chat a bit with Don Archer. So I'm making advertisment. The only (to my knowledge) gallery devoted completely to computer art should be supported!

mardi 5 mai 2009

samedi 2 mai 2009

Another fast algorithm for Voronoi patterns

Voronoi patterns are drawn in the following way. Pick points randomly in the plane. Then color each pixel according to its distance to the closest among the chosen points. You get something like this :

or like this

if you use a slightly more elaborate function of the distance.

The trouble is that such an algorithm is not efficiently implemented in Ultra Fractal. The latter computes pixel by pixel : the same algorithm is repeated for each pixel, only the input consisting of the pixel coordinates change. Therefore with a naive algorithm, for each pixel, one has to compute the distances to all of the points (to find the closest one) which requires a huge amount of computations.

One possible improvement is to avoid picking points completely randomly. If one chooses each of them randomly in a region centered on a vertex of a regular gird, then, given a pixel, it is possible to find the closed point by computing only a very small number of distances.  This improves the speed of the algorithm spectacularly. Moreover, by tuning the maximal distance from a point to the corresponding vertex of the gird, one can interpolate between a completely regular gird and something close to a true Voronoi pattern, what can be interesting artistically. For instance the image below, while still retaining some randomness, is much closer to a regular square tiling than the image above. The trouble with this kind of algorithms is that the patterns they produce are necessarily too regular, compared to a genuine Voronoi tiling.

There is a third algorithm which seems to work pretty well. Simply choose the random points as the vertice of regular girds which are randomly scaled and rotated. It is very easy to test the distance of a pixel to the vertice of a gird, so this algorithm is quite fast. If all the girds are large enough and if there are sufficiently many of them, the result is pretty close (at least to the eye) to a true Voronoi pattern, and does not suffer the lack of randomness of the previous algorithm. 

Finally, here is an image made with this algorithm. The leaf shapes which are aparently randomly distributed are actually on the vertice of square girds. The basic pattern was summed at various scales to produce an interesting image and give it a fractal flavour. You can zoom on this image here.