
On this page I continue to describe the development of my computer program ConjurePicture (ConjPic for short) for the creation of images using Iterated Function Systems (a branch of Fractal Geometry). As well as showing some of the resulting images, I will show some of the itermediate template images that are used to generate those images.
This page is a continuation of page ConjurePicture, which contains the Table of contents.
Go Home.
Chapter 3: Building a maple leaf
3.1 Why build a maple leaf?
We shall proceed in stages to first build a twig, then a tree, and finally a maple leaf. Building a tree is fundamental to these efforts. It is also fundamental to building a variety of objects, including mountains, flowers, and hair.
3.1.1 Building a twig
So let us proceed from humble beginnings and build a twig. First some jargon. Let us denote the pictorial description of the IFS in terms of tiles or blocks as the "template" of the IFS.
Let us take the template for the Sierpinski Gasket above and modify it as follows. Take the bottom tile, squeeze it sideways, then center it below the top tiles to produce the source of what will become the stem of the twig, or the trunk of a tree. Next, take the top left tile and rotate it counterclockwise by, say, 45 degrees. Ditto for the top right tile, but clockwise. The result is the following figure T1Twig1T.gif.

Figure T1Twig1T.gif. Template for Twig. [C:\My Documents\WayneSite\Images\T1Twig1T.gif (22 KB)]
Can you guess what will emerge from this IFS? Here it is, in the following figure T1Twig1I.gif.
Figure T1Twig1I.gif. Image of twig, rendering 1 stem (green). (Start.)

Figure T1Twig1I.gif. Image of twig, rendering 1 stem (green). (End.)
[C:\Program Files\hjpro\bin\T1Twig1I.gif (46*** KB)]
*** As we progress through this sequence of images, there will be a temporary disjoint between the storage figures for gif and jpg images, as some were stored in both formats, having originated from the ConjPic program as bmp bitmaps, then compressed. This situation will be resolved in later updates, but not overnight.
So, weve grown a twig! (Maybe its been genetically modified to show red leaves off the left branchs branches and yellow ones on the right! Mad Twig Disease?)
You might wonder why the above image for the twig template is stored as a gif image rather than as a jpg one, whereas all of my photographic images are stored in jpg format. The reasons are twofold. Although the jpg version will have the full range of colors instead of the gif limitation to 256 colors, the gif version is superior in treating images such as the twig template, in which the narrow lines produce sharp discontinuities. The jpg version produces noticeable artifacts because of the sharp edge effects of the narrow twig branches. In other words, in a Fourier-type analysis, the narrower the line, the higher the frequency in the frequency spectrum. These take on the appearance of ghost images of the branches, also called Gibbs artifacts.
The Twig and Gasket IFSs share three common characteristics. They each have three transforms, there are two top ones above a bottom one, and they have the same three colors. But there is a glaring difference, even apart from the shape. That is: why are the Twig colors distinct in their branches, whereas the Gasket colors are scattered at random, even though, in both cases, the transformations, and hence their colors, were chosen at random? The answer is that we have added an additional characteristic to the Twig IFS, namely, a rendering of branching levels.
In the case of the Twig, we wanted its stem to branch upward having the same color as the primary stem at the bottom. Furthermore, we wanted the branches on each of those branches, and the branches on those branches, and , to the level of the sixth branch, to all have the same color, green. We say that the program is using a rendering procedure in which we have specified two things: that the bottom IFS is a stem, that its color is green, and that we are to propagate from the stem upwards (in this case) that same color through each level of succeeding branches, up to a "branching level" of six. By a branching level of one, we would mean that only the first branch level upward from the stem is to share the stem color. In the Twig case, the branches at level one are the first two branches that touch the stem. Branches at level two would be the first branches that proceed beyond, yet still touch, the branches at level one, and so on, up to level six. In the above Twig, you can count out and trace upward from branch one to branch six. Branch six is barely half a cm long, and is the last branch level to be colored green.
Lets fancy it up a bit, to yield the following figure T1Twig2I.gif.
Figure T1Twig2I.gif. Image of twig, rendering 2 stems (green & white) to 6 branching levels. (Start.)

Figure T1Twig2I.gif. Image of twig, rendering 2 stems (green & white) to 6 branching levels. (End.)
[C:\Program Files\hjpro\bin\T1Twig2I.jpg (50 KB)]
To the original stem, stem 1, in green, we have added a second stem, stem 2, in white. Stem 2 is shorter than stem 1 and has been placed on top of stem 1. Oops, the term "2 twigs" in the green caption bar under the picture should read "2 stems".
3.1.2 Building our first tree
Adding a single transform (blue tile at top center) to the IFS template yields the following image T1Tree1I.gif .
Figure T1Tree1I.gif. Image of tree1, rendering 2 stems (green and white) to 6 branching levels. (Start.)

Figure T1Tree1I.gif. Image of tree1, rendering 2 stems (green and white) to 6 branching levels. (End.)
[C:\Program Files\hjpro\bin\T1Tree1I.gif (77 KB)]
Note that this single additional transform (in blue) has propagated the stem and its branches upward in multiple copies. The tree is too stylized and symmetric to look like the photograph of a real tree yet, but the basics are there to be able to build on. To "move" the image closer to reality, we would have to add some rough edges and some asymmetry. We will get to that later.
Some additional adjustments to the IFS template gives the following template T1Tree2T.gif.

Figure T1Tree2T.gif. Template for tree2, rendering 2 stems (green and white) to 6 branching levels.
[C:\Program Files\hjpro\bin\T1Tree2T.jpg (23 KB)]
There are two significant changes that we have made. We have moved the "branching" tiles (in pink and yellow) downward and outward (horizontally). Secondly, we have moved the central (blue) tile downward and expanded it vertically. We have left the stems (in green and white) unchanged. Without having yet had a full explanation of the process, try to visualize roughly what kind of image should emerge.
Emerging from the template above is the following image T1Tree2I.gif.
Figure T1Tree2I.gif. Image of tree2, rendering 2 stems (green and white) to 6 branching levels. (Start.)

Figure T1Tree2I.gif. Image of tree2, rendering 2 stems (green and white) to 6 branching levels. (End.)
[C:\Program Files\hjpro\bin\T1Tree2I.jpg (53 KB)]
So, we have grown a tree before we have even built a leaf! Correction: we may not have built a single leaf, recognizable as such. We may have, instead, built a whole collection of leaves, if we want to interpret them as being leaves on a deciduous tree, instead of, for example, bunches of needles on an evergreen tree! In our world of generating images, it is not usually evident in everyday life how important is the interpretive capability of the brain in creating what we perceive as an image! The eye-brain system is far from being the equivalent of "just" a video-camera system, focusing light onto some kind of projector screen in our brain. The brain has a remarkable ability to interpret the light that enters our eyes and to create for us what we perceive as being an image of part of the external world.
Many millennia of evolution have shaped the perceptive abilities of our brain, such that, without there being any "aim" of evolution to call upon, those kinds of people who survived over these millenia would have had the ability to sense danger quickly enough to improve their odds of surviving. A modern-day hunter reflects this innate ability and illustrates this sense of interpretive perception. He hunts at dusk, glancing periodically in different directions to spot his prey, but generally looking somewhat away from where he would expect to see prey. Doesnt that sound contrary to common sense, given that our ability to perceive detail is restricted to a very small cone of angles straight ahead? The hunter maintains, however, that he is able to detect new game more readily through his peripheral vision than through direct forward vision. This may sound odd if we assume that what the hunter should detect is detail. But, of far more importance to the hunter, or to the hunter as potential victim, is detecting the mere existence of something new, especially if it is something moving, and especially if it could be a threat to him. Yes, maybe it could be a tiger in the bushes, that has just moved a tiny bit before pouncing! Is it just a coincidence that peripheral vision is more sensitive to movement of an object than is direct vision? Is it also just a coincidence that, at dusk, the sense of color in vision is greatly suppressed, and that a different mechanism of rods vs. cones in the retina prevailsone that sacrifices the luxury of full-color rendition for the more immediate necessity of more acute monochrome perception, thereby affording better chances of seeing an enemy sooner?
There are other aspects of interpretive vision that are of great interest, but we only mention them in passing. One is the apparent ability of the brain to try to extract some kind of meaning from an image. That is why one can sometimes "see" sand-castles in the sky, or ghosts, or UFOs. If we "see" something, does it mean that that something is real? Does it mean that a psychiatrist should try to interpret some kind of meaning from a patients report of what kind of meaning an inkblot has for him? We wont even try to pursue that! Just give it a thought.
What has the above digression have to do with our creation and perception of images? We should always keep the viewer in mind as to what the image might mean to him or her. There are at least two senses of what "mean" might mean. First, there is what common sense might say is direct perception, as in the case of the hunter perceiving a flicker of movement in his peripheral vision. Secondly, there is the derived meaning that this perception might have. In the case of the hunter, it could be an immediate and visceral sense of danger, heightened awareness, fear, and the brains automatic commands, already issued without the hunters awareness or permission, to instantly pump adrenaline into the blood stream, and to enter a stage of hyperactive alertness.
At a third level, the perception of an image might evoke different responses from different people based on their personal experiences and culture. Consider the example of someone walking along a street in a city that he was just visiting for the first time. He glances upwards and notices for the first time that a slightly unusual building ahead of him has a tower atop its front, peaked with a swastika. What to make of this? If one were a Jew, one might react involuntarily with a sense of horror and might start to wonder whether he had wandered into a side street having the headquarters of a neo-nazi organization, complete with Christian pastor in attendance. If, however, he were a Hindu, he might react in immediate joy and reverence upon seeing the swastika, a revered symbol of his religion, and an encouraging sign that he had had the good fortune to arrive at a Hindu temple. The swastika has been a revered symbol of Hinduism for centuries, in contrast to its relatively recent resurrection as a symbol of Nazism.
3.1.3 Building a maple leaf
Some additional adjustments to the IFS template gives the following image T1MapL1I.jpg .
This figure can be seen, in miniature, at the top of this page, and in a larger size at the bottom of the Big logo page.
Figure T1MapL1I.jpg. Image of maple tree 1, rendering 2 stems (green at bottom center, and red at top) to 6 branching levels.
[C:\Program Files\hjpro\bin\T1MapL1I.jpg (77 KB)]
The Total Compression Ratio here is
TCR = FCR( ) * JCR 1,000 KB/77 KB) = (Insert CR value of FCR from lower right corner of green caption above.)
In the green caption at the bottom of the picture, "1 stem" should be "2 stems". Stem 1, the primary stem, in lime green, is the most understandable: it is the vertical "trunk" at the lower center of the leaf-tree object. Of the other six tiles, all of them, except for the tile at top center, contribute to propagating stem 1 throughout the leaf. Stem 2 is at top center, colored in bright red. It is a tile that is almost as large as the two main ones below it that are angled about 45 degrees toward left and right, but it is narrower horizontally than those. Therefore, it is not a stem in the ordinary sense. However, its effects are also propagated throughout the leaf as the dominating bright red color at the edges of the leaf. In fact, its red overpowers to a great extent the assigned colors of the other tiles. Those tile colors (and the tile numbers (5 to 11)) are shown as the circles in the top left corner of the picture box. The bottom two double circles, numbered 99 and 100, have no bearing on the present image; their use will be dealt with in another chapter. For example, the dark green on the first left branch off of the lower part of the main stem is a remnant of a dark green tile (no. 10) in that position. This degree of dominance by the red of stem 2 would be lessened if the number of branching levels was less than the number 6 used here (denoted "6 branches" in the figure above). However, the tradeoff for having a lower branching level is less merging of colors in this particular case.
The blending of colors will be dealt with as part of the larger topic of rendering to be presented in a later chapter.
To be continued . . .
. . . Contiued at Chapter 6: Building a mountain. (ConPic40)
<O>
® The terms ConjurePicture® and ConjPic® are © and ® Wayne R. Paulson, 2000. All rights reserved.
® HiJaak Pro® is a registered trademark of Quarterdeck Corporation.
Go Home. Go to Table of contents.
You can e-mail me at waynerp@sympatico.ca