1Ppmforge User Manual(0) Ppmforge User Manual(0)
2
3
4
6 ppmforge - fractal forgeries of clouds, planets, and starry skies
7
9 ppmforge
10
11 [-clouds] [-night] [-dimension dimen] [-hour hour] [-inclination|-tilt
12 angle] [-mesh size] [-power factor] [-glaciers level] [-ice level]
13 [-saturation sat] [-seed seed] [-stars fraction] [{-xsize|-width}
14 width] [{-ysize|-height} height]
15
16
18 This program is part of Netpbm(1).
19
20 ppmforge generates three kinds of ``random fractal forgeries,'' the
21 term coined by Richard F. Voss of the IBM Thomas J. Watson Research
22 Center for seemingly realistic pictures of natural objects generated by
23 simple algorithms embodying randomness and fractal self-similarity.
24 The techniques used by ppmforge are essentially those given by Voss[1],
25 particularly the technique of spectral synthesis explained in more
26 detail by Dietmar Saupe[2].
27
28 The program generates two varieties of pictures: planets and clouds,
29 which are just different renderings of data generated in an identical
30 manner, illustrating the unity of the fractal structure of these very
31 different objects. A third type of picture, a starry sky, is synthe‐
32 sised directly from pseudorandom numbers.
33
34 The generation of planets or clouds begins with the preparation of an
35 array of random data in the frequency domain. The size of this array,
36 the ``mesh size,'' can be set with the -mesh option; the larger the
37 mesh the more realistic the pictures but the calculation time and mem‐
38 ory requirement increases as the square of the mesh size. The fractal
39 dimension, which you can specify with the -dimension option, determines
40 the roughness of the terrain on the planet or the scale of detail in
41 the clouds. As the fractal dimension is increased, more high frequency
42 components are added into the random mesh.
43
44 Once the mesh is generated, an inverse two dimensional Fourier trans‐
45 form is performed upon it. This converts the original random frequency
46 domain data into spatial amplitudes. We scale the real components that
47 result from the Fourier transform into numbers from 0 to 1 associated
48 with each point on the mesh. You can further modify this number by
49 applying a ``power law scale'' to it with the -power option. Unity
50 scale leaves the numbers unmodified; a power scale of 0.5 takes the
51 square root of the numbers in the mesh, while a power scale of 3
52 replaces the numbers in the mesh with their cubes. Power law scaling
53 is best envisioned by thinking of the data as representing the eleva‐
54 tion of terrain; powers less than 1 yield landscapes with vertical
55 scarps that look like glacially-carved valleys; powers greater than one
56 make fairy-castle spires (which require large mesh sizes and high reso‐
57 lution for best results).
58
59 After these calculations, we have a array of the specified size con‐
60 taining numbers that range from 0 to 1. ppmforge generates as follows:
61
62
63
64 Clouds A color map is created that ranges from pure blue to white by
65 increasing admixture (desaturation) of blue with white. Numbers
66 less than 0.5 are colored blue, numbers between 0.5 and 1.0 are
67 colored with corresponding levels of white, with 1.0 being pure
68 white.
69
70
71 Planet The mesh is projected onto a sphere. Values less than 0.5 are
72 treated as water and values between 0.5 and 1.0 as land. The
73 water areas are colored based upon the water depth, and land
74 based on its elevation. The random depth data are used to cre‐
75 ate clouds over the oceans. An atmosphere approximately like
76 the Earth's is simulated; its light absorption is calculated to
77 create a blue cast around the limb of the planet. A function
78 that rises from 0 to 1 based on latitude is modulated by the
79 local elevation to generate polar ice caps--high altitude ter‐
80 rain carries glaciers farther from the pole. Based on the posi‐
81 tion of the star with respect to the observer, the apparent
82 color of each pixel of the planet is calculated by ray-tracing
83 from the star to the planet to the observer and applying a
84 lighting model that sums ambient light and diffuse reflection
85 (for most planets ambient light is zero, as their primary star
86 is the only source of illumination). Additional random data are
87 used to generate stars around the planet.
88
89
90 Night A sequence of pseudorandom numbers is used to generate stars
91 with a user specified density.
92
93
94 Cloud pictures always contain 256 or fewer colors and may be displayed
95 on most color mapped devices without further processing. Planet pic‐
96 tures often contain tens of thousands of colors which must be com‐
97 pressed with pnmquant or ppmdither before encoding in a color mapped
98 format. If the display resolution is high enough, ppmdither generally
99 produces better looking planets. pnmquant tends to create discrete
100 color bands, particularly in the oceans, which are unrealistic and dis‐
101 tracting. The number of colors in starry sky pictures generated with
102 the -night option depends on the value specified for -saturation.
103 Small values limit the color temperature distribution of the stars and
104 reduce the number of colors in the image. If the -saturation is set to
105 0, none of the stars will be colored and the resulting image will never
106 contain more than 256 colors. Night sky pictures with many different
107 star colors often look best when color compressed by pamdepth rather
108 than pnmquant or ppmdither. Try newmaxval settings of 63, 31, or 15
109 with pamdepth to reduce the number of colors in the picture to 256 or
110 fewer.
111
112
113
115 You can abbreviate any options to its shortest unique prefix.
116
117
118
119 -clouds
120 Generate clouds. An image of fractal clouds is generated.
121 Selecting clouds sets the default for fractal dimension to 2.15
122 and power scale factor to 0.75.
123
124
125 -dimension dimen
126 Sets the fractal dimension to the specified dimen, which may be
127 any floating point value between 0 and 3. Higher fractal dimen‐
128 sions create more ``chaotic'' images, which require higher reso‐
129 lution output and a larger FFT mesh size to look good. If no
130 dimension is specified, 2.4 is used when generating planets and
131 2.15 for clouds.
132
133
134 -glaciers level
135 The floating point level setting controls the extent to which
136 terrain elevation causes ice to appear at lower latitudes. The
137 default value of 0.75 makes the polar caps extend toward the
138 equator across high terrain and forms glaciers in the highest
139 mountains, as on Earth. Higher values make ice sheets that
140 cover more and more of the land surface, simulating planets in
141 the midst of an ice age. Lower values tend to be boring,
142 resulting in unrealistic geometrically-precise ice cap bound‐
143 aries.
144
145
146 -hour hour
147 When generating a planet, ppmforge uses hour as the 'hour angle
148 at the central meridian.' If you specify -hour 12, for example,
149 the planet will be fully illuminated, corresponding to high noon
150 at the longitude at the center of the screen. You can specify
151 any floating point value between 0 and 24 for hour, but values
152 which place most of the planet in darkness (0 to 4 and 20 to 24)
153 result in crescents which, while pretty, don't give you many
154 illuminated pixels for the amount of computing that's required.
155 If no -hour option is specified, a random hour angle is chosen,
156 biased so that only 25% of the images generated will be cres‐
157 cents.
158
159
160 -ice level
161 Sets the extent of the polar ice caps to the given floating
162 point level. The default level of 0.4 produces ice caps similar
163 to those of the Earth. Smaller values reduce the amount of ice,
164 while larger -ice settings create more prominent ice caps. Suf‐
165 ficiently large values, such as 100 or more, in conjunction with
166 small settings for -glaciers (try 0.1) create 'ice balls' like
167 Europa.
168
169
170 -inclination|-tilt angle
171 The inclination angle of the planet with regard to its primary
172 star is set to angle, which can be any floating point value from
173 -90 to 90. The inclination angle can be thought of as specify‐
174 ing, in degrees, the ``season'' the planet is presently experi‐
175 encing or, more precisely, the latitude at which the star tran‐
176 sits the zenith at local noon. If 0, the planet is at equinox;
177 the star is directly overhead at the equator. Positive values
178 represent summer in the northern hemisphere, negative values
179 summer in the southern hemisphere. The Earth's inclination
180 angle, for example, is about 23.5 at the June solstice, 0 at the
181 equinoxes in March and September, and -23.5 at the December sol‐
182 stice. If no inclination angle is specified, a random value
183 between -21.6 and 21.6 degrees is chosen.
184
185
186 -mesh size
187 A mesh of size by size will be used for the fast Fourier trans‐
188 form (FFT). Note that memory requirements and computation speed
189 increase as the square of size; if you double the mesh size, the
190 program will use four times the memory and run four times as
191 long. The default mesh is 256x256, which produces reasonably
192 good looking pictures while using half a megabyte for the
193 256x256 array of single precision complex numbers required by
194 the FFT. On machines with limited memory capacity, you may have
195 to reduce the mesh size to avoid running out of RAM. Increasing
196 the mesh size produces better looking pictures; the difference
197 becomes particularly noticeable when generating high resolution
198 images with relatively high fractal dimensions (between 2.2 and
199 3).
200
201
202 -night A starry sky is generated. The stars are created by the same
203 algorithm used for the stars that surround planet pictures, but
204 the output consists exclusively of stars.
205
206
207 -power factor
208 Sets the 'power factor' used to scale elevations synthesised
209 from the FFT to factor, which can be any floating point number
210 greater than zero. If no factor is specified a default of 1.2
211 is used if a planet is being generated, or 0.75 if clouds are
212 selected by the -clouds option. The result of the FFT image
213 synthesis is an array of elevation values between 0 and 1. A
214 non-unity power factor exponentiates each of these elevations to
215 the specified power. For example, a power factor of 2 squares
216 each value, while a power factor of 0.5 replaces each with its
217 square root. (Note that exponentiating values between 0 and 1
218 yields values that remain within that range.) Power factors
219 less than 1 emphasise large-scale elevation changes at the
220 expense of small variations. Power factors greater than 1
221 increase the roughness of the terrain and, like high fractal
222 dimensions, may require a larger FFT mesh size and/or higher
223 screen resolution to look good.
224
225
226 -saturation sat
227 Controls the degree of color saturation of the stars that sur‐
228 round planet pictures and fill starry skies created with the
229 -night option. The default value of 125 creates stars which
230 resemble the sky as seen by the human eye from Earth's surface.
231 Stars are dim; only the brightest activate the cones in the
232 human retina, causing color to be perceived. Higher values of
233 sat approximate the appearance of stars from Earth orbit, where
234 better dark adaptation, absence of skyglow, and the concentra‐
235 tion of light from a given star onto a smaller area of the
236 retina thanks to the lack of atmospheric turbulence enhances the
237 perception of color. Values greater than 250 create ``science
238 fiction'' skies that, while pretty, don't occur in this uni‐
239 verse.
240
241 Thanks to the inverse square law combined with Nature's love of
242 mediocrity, there are many, many dim stars for every bright one.
243 This population relationship is accurately reflected in the
244 skies created by ppmforge. Dim, low mass stars live much longer
245 than bright massive stars, consequently there are many reddish
246 stars for every blue giant. This relationship is preserved by
247 ppmforge. You can reverse the proportion, simulating the sky as
248 seen in a starburst galaxy, by specifying a negative sat value.
249
250
251 -seed num
252 Sets the seed for the random number generator to the integer
253 num. The seed used to create each picture is displayed on stan‐
254 dard output (unless suppressed with the -quiet option). Pic‐
255 tures generated with the same seed will be identical. If no
256 -seed is specified, a random seed derived from the date and time
257 will be chosen. Specifying an explicit seed allows you to re-
258 render a picture you particularly like at a higher resolution or
259 with different viewing parameters.
260
261
262 -stars fraction
263 Specifies the percentage of pixels, in tenths of a percent,
264 which will appear as stars, either surrounding a planet or fill‐
265 ing the entire frame if -night is specified. The default frac‐
266 tion is 100.
267
268
269 -xsize|-width width
270 Sets the width of the generated image to width pixels. The
271 default width is 256 pixels. Images must be at least as wide as
272 they are high; if a width less than the height is specified, it
273 will be increased to equal the height. If you must have a long
274 skinny image, make a square one with ppmforge, then use pamcut
275 to extract a portion of the shape and size you require.
276
277
278 -ysize|-height height
279 Sets the height of the generated image to height pixels. The
280 default height is 256 pixels. If the height specified exceeds
281 the width, the width will be increased to equal the height.
282
283
284
285
287 The algorithms require the output image to be at least as wide as it is
288 high, and the width to be an even number of pixels. These constraints
289 are enforced by increasing the size of the requested image if neces‐
290 sary.
291
292 You may have to reduce the FFT mesh size on machines with 16 bit inte‐
293 gers and segmented pointer architectures.
294
295
297 pamcut(1), pamdepth(1), ppmdither(1), pnmquant(1), ppm(1)
298
299
300
301 [1] Voss, Richard F., ``Random Fractal Forgeries,'' in Earnshaw et.
302 al., Fundamental Algorithms for Computer Graphics, Berlin:
303 Springer-Verlag, 1985.
304
305
306 [2] Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal
307 Images, New York: Springer Verlag, 1988.
308
309
310
311
313 John Walker
314 Autodesk SA
315 Avenue des Champs-Montants 14b
316 CH-2074 MARIN
317 Suisse/Schweiz/Svizzera/Svizra/Switzerland
318 Usenet:kelvin@Autodesk.com
319 Fax:038/33 88 15
320 Voice:038/33 76 33
321
322 Permission to use, copy, modify, and distribute this software and its
323 documentation for any purpose and without fee is hereby granted, with‐
324 out any conditions or restrictions. This software is provided ``as
325 is'' without express or implied warranty.
326
327
328 PLUGWARE!
329 If you like this kind of stuff, you may also enjoy ``James Gleick's
330 Chaos--The Software'' for MS-DOS, available for $59.95 from your local
331 software store or directly from Autodesk, Inc., Attn: Science Series,
332 2320 Marinship Way, Sausalito, CA 94965, USA. Telephone: (800)
333 688-2344 toll-free or, outside the U.S. (415) 332-2344 Ext 4886. Fax:
334 (415) 289-4718. ``Chaos--The Software'' includes a more comprehensive
335 fractal forgery generator which creates three-dimensional landscapes as
336 well as clouds and planets, plus five more modules which explore other
337 aspects of Chaos. The user guide of more than 200 pages includes an
338 introduction by James Gleick and detailed explanations by Rudy Rucker
339 of the mathematics and algorithms used by each program.
340
341
342
343netpbm documentation 25 October 1991 Ppmforge User Manual(0)