Penguin
Annotated edit history of ppmforge(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 ppmforge
2 !!!ppmforge
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 BUGS
8 SEE ALSO
9 AUTHOR
10 ----
11 !!NAME
12
13
14 ppmforge - fractal forgeries of clouds, planets, and starry skies
15 !!SYNOPSIS
16
17
18 __ppmforge__ [[__-clouds__] [[__-night__]
19 [[__-dimension__ ''dimen''] [[__-hour__ ''hour'']
20 [[__-inclination|-tilt__ ''angle''] [[__-mesh__
21 ''size''] [[__-power__ ''factor''] [[__-glaciers__
22 ''level''] [[__-ice__ ''level''] [[__-saturation__
23 ''sat''] [[__-seed__ ''seed''] [[__-stars__
24 ''fraction''] [[__-xsize|-width__ ''width'']
25 [[__-ysize|-height__ ''height'']
26 !!DESCRIPTION
27
28
29 __ppmforge__ generates three kinds of ``random fractal
30 forg- eries,'' the term coined by Richard F. Voss of the IBM
31 Thomas J. Watson Research Center for seemingly realistic
32 pictures of natural objects generated by simple algorithms
33 embodying randomness and fractal self-similarity. The
34 techniques used by __ppmforge__ are essentially those
35 given by Voss[[1], particularly the technique of spectral
36 synthesis explained in more detail by Dietmar
37 Saupe[[2].
38
39
40 The program generates two varieties of pictures: planets and
41 clouds, which are just different renderings of data
42 generated in an identical manner, illustrating the unity of
43 the fractal structure of these very different objects. A
44 third type of picture, a starry sky, is synthesised di-
45 rectly from pseudorandom numbers.
46
47
48 The generation of planets or clouds begins with the prepa-
49 ration of an array of random data in the frequency domain.
50 The size of this array, the ``mesh size,'' can be set with
51 the __-mesh__ option; the larger the mesh the more
52 realistic the pictures but the calculation time and memory
53 require- ment increases as the square of the mesh size. The
54 frac- tal dimension, which you can specify with the
55 __-dimension__ option, determines the roughness of the
56 terrain on the planet or the scale of detail in the clouds.
57 As the frac- tal dimension is increased, more high frequency
58 components are added into the random mesh.
59
60
61 Once the mesh is generated, an inverse two dimensional
62 Fourier transform is performed upon it. This converts the
63 original random frequency domain data into spatial ampli-
64 tudes. We scale the real components that result from the
65 Fourier transform into numbers from 0 to 1 associated with
66 each point on the mesh. You can further modify this num- ber
67 by applying a ``power law scale'' to it with the __-pow-
68 er__ option. Unity scale leaves the numbers unmodified; a
69 power scale of 0.5 takes the square root of the numbers in
70 the mesh, while a power scale of 3 replaces the numbers in
71 the mesh with their cubes. Power law scaling is best en-
72 visioned by thinking of the data as representing the ele-
73 vation of terrain; powers less than 1 yield landscapes with
74 vertical scarps that look like glacially-carved val- leys;
75 powers greater than one make fairy-castle spires (which
76 require large mesh sizes and high resolution for best
77 results).
78
79
80 After these calculations, we have a array of the specified
81 size containing numbers that range from 0 to 1. The pixmaps
82 are generated as follows:
83
84
85 __Clouds__
86
87
88 A colour map is created that ranges from pure blue to white
89 by increasing admixture (desatura- tion) of blue with white.
90 Numbers less than 0.5 are coloured blue, numbers between 0.5
91 and 1.0 are coloured with corresponding levels of white,
92 with 1.0 being pure white.
93
94
95 __Planet__
96
97
98 The mesh is projected onto a sphere. Values less than 0.5
99 are treated as water and values between 0.5 and 1.0 as land.
100 The water areas are coloured based upon the water depth, and
101 land based on its elevation. The random depth data are used
102 to create clouds over the oceans. An atmosphere
103 approximately like the Earth's is simulated; its light
104 absorption is calculated to create a blue cast around the
105 limb of the plan- et. A function that rises from 0 to 1
106 based on latitude is modulated by the local elevation to
107 generate polar ice caps--high altitude terrain carries
108 glaciers farther from the pole. Based on the position of the
109 star with respect to the observer, the apparent colour of
110 each pixel of the planet is calculated by ray-tracing from
111 the star to the planet to the observer and applying a
112 lighting model that sums ambient light and diffuse
113 reflection (for most planets ambient light is zero, as their
114 primary star is the only source of illumination). Additional
115 random data are used to generate stars around the
116 planet.
117
118
119 __Night__
120
121
122 A sequence of pseudorandom numbers is used to generate stars
123 with a user specified density.
124
125
126 Cloud pictures always contain 256 or fewer colours and may
127 be displayed on most colour mapped devices without further
128 processing. Planet pictures often contain tens of thou-
129 sands of colours which must be compressed with
130 __ppmquant__ or __ppmdither__ before encoding in a
131 colour mapped format. If the display resolution is high
132 enough, __ppmdither__ generally produces better looking
133 planets. __ppmquant__ tends to create discrete colour
134 bands, particularly in the oceans, which are unrealistic and
135 distracting. The number of colours in starry sky pictures
136 generated with the __-night__ option de- pends on the
137 value specified for __-saturation__. Small val- ues limit
138 the colour temperature distribution of the stars and reduce
139 the number of colours in the image. If the
140 __-saturation__ is set to 0, none of the stars will be
141 coloured and the resulting image will never contain more
142 than 256 colours. Night sky pictures with many different
143 star colours often look best when colour compressed by
144 __pn- mdepth__ rather than __ppmquant__ or
145 __ppmdither__. Try ''newmaxval'' settings of 63, 31,
146 or 15 with __pnmdepth__ to reduce the num- ber of colours
147 in the picture to 256 or fewer.
148 !!OPTIONS
149
150
151 __-clouds__
152
153
154 Generate clouds. A pixmap of fractal clouds is generated.
155 Selecting clouds sets the default for fractal dimension to
156 2.15 and power scale factor to 0.75.
157
158
159 __-dimension__ ''dimen''
160
161
162 Sets the fractal dimension to the specified ''di- men'',
163 which may be any floating point value be- tween 0 and 3.
164 Higher fractal dimensions create more ``chaotic'' images,
165 which require higher resolution output and a larger FFT mesh
166 size to look good. If no dimension is specified, 2.4 is used
167 when generating planets and 2.15 for clouds.
168
169
170 __-glaciers__ ''level''
171
172
173 The floating point ''level'' setting controls the extent
174 to which terrain elevation causes ice to appear at lower
175 latitudes. The default value of 0.75 makes the polar caps
176 extend toward the equator across high terrain and forms
177 glaciers in the highest mountains, as on Earth. Higher
178 values make ice sheets that cover more and more of the land
179 surface, simulating planets in the midst of an ice age.
180 Lower values tend to be boring, resulting in unrealistic
181 geometrical- ly-precise ice cap boundaries.
182
183
184 __-hour__ ''hour''
185
186
187 When generating a planet, ''hour'' is used as the ``hour
188 angle at the central meridian.'' If you specify __-hour
189 12__, for example, the planet will be fully illuminated,
190 corresponding to high noon at the longitude at the centre of
191 the screen. You can specify any floating point value between
192 0 and 24 for ''hour'', but values which place most of the
193 planet in darkness (0 to 4 and 20 to 24) result in crescents
194 which, while pretty, don't give you many illuminated pixels
195 for the amount of computing that's required. If no
196 __-hour__ op- tion is specified, a random hour angle is
197 cho- sen, biased so that only 25% of the images gen- erated
198 will be crescents.
199
200
201 __-ice__ ''level''
202
203
204 Sets the extent of the polar ice caps to the given floating
205 point ''level''. The default level of 0.4 produces ice
206 caps similar to those of the Earth. Smaller values reduce
207 the amount of ice, while larger __-ice__ settings create
208 more prominent ice caps. Sufficiently large values, such as
209 100 or more, in conjunction with small settings for
210 __-glaciers__ (try 0.1) create ``ice balls'' like
211 Europa.
212
213
214 __-inclination|-tilt__ ''angle''
215
216
217 The inclination angle of the planet with regard to its
218 primary star is set to ''angle'', which can be any
219 floating point value from -90 to 90. The inclination angle
220 can be thought of as specify- ing, in degrees, the
221 ``season'' the planet is presently experiencing or, more
222 precisely, the latitude at which the star transits the
223 zenith at local noon. If 0, the planet is at equinox; the
224 star is directly overhead at the equator. Positive values
225 represent summer in the northern hemisphere, negative values
226 summer in the south- ern hemisphere. The Earth's inclination
227 angle, for example, is about 23.5 at the June solstice, 0 at
228 the equinoxes in March and September, and -23.5 at the
229 December solstice. If no inclina- tion angle is specified, a
230 random value between -21.6 and 21.6 degrees is
231 chosen.
232
233
234 __-mesh__ ''size''
235
236
237 A mesh of ''size'' by ''size'' will be used for the
238 fast Fourier transform (FFT). Note that memory re-
239 quirements and computation speed increase as the square of
240 ''size''; if you double the mesh size, the program will
241 use four times the memory and run four times as long. The
242 default mesh is 256x256, which produces reasonably good
243 looking pictures while using half a megabyte for the 256x256
244 array of single precision complex num- bers required by the
245 FFT. On machines with lim- ited memory capacity, you may
246 have to reduce the mesh size to avoid running out of RAM.
247 Increas- ing the mesh size produces better looking pic-
248 tures; the difference becomes particularly no- ticeable when
249 generating high resolution images with relatively high
250 fractal dimensions (between 2.2 and 3).
251
252
253 __-night__
254
255
256 A starry sky is generated. The stars are creat- ed by the
257 same algorithm used for the stars that surround planet
258 pictures, but the output con- sists exclusively of
259 stars.
260
261
262 __-power__ ''factor''
263
264
265 Sets the ``power factor'' used to scale eleva- tions
266 synthesised from the FFT to ''factor'', which can be any
267 floating point number greater than zero. If no factor is
268 specified a default of 1.2 is used if a planet is being
269 generated, or 0.75 if clouds are selected by the
270 __-clouds__ op- tion. The result of the FFT image
271 synthesis is an array of elevation values between 0 and 1. A
272 non-unity power factor exponentiates each of these
273 elevations to the specified power. For example, a power
274 factor of 2 squares each value, while a power factor of 0.5
275 replaces each with its square root. (Note that
276 exponentiating val- ues between 0 and 1 yields values that
277 remain within that range.) Power factors less than 1
278 emphasise large-scale elevation changes at the expense of
279 small variations. Power factors greater than 1 increase the
280 roughness of the terrain and, like high fractal dimensions,
281 may require a larger FFT mesh size and/or higher screen
282 resolution to look good.
283
284
285 __-saturation__ ''sat''
286
287
288 Controls the degree of colour saturation of the stars that
289 surround planet pictures and fill starry skies created with
290 the __-night__ option. The default value of 125 creates
291 stars which re- semble the sky as seen by the human eye from
292 Earth's surface. Stars are dim; only the brightest activate
293 the cones in the human reti- na, causing colour to be
294 perceived. Higher val- ues of ''sat'' approximate the
295 appearance of stars from Earth orbit, where better dark
296 adaptation, absence of skyglow, and the concentration of
297 light from a given star onto a smaller area of the retina
298 thanks to the lack of atmospheric turbulence enhances the
299 perception of colour. Values greater than 250 create
300 ``science fic- tion'' skies that, while pretty, don't occur
301 in this universe.
302
303
304 Thanks to the inverse square law com- bined with Nature's
305 love of mediocrity, there are many, many dim stars for every
306 bright one. This population relationship is accurately re-
307 flected in the skies created by __ppmforge__. Dim, low
308 mass stars live much longer than bright mas- sive stars,
309 consequently there are many reddish stars for every blue
310 giant. This relationship is preserved by __ppmforge__.
311 You can reverse the proportion, simulating the sky as seen
312 in a starburst galaxy, by specifying a negative ''sat''
313 value.
314
315
316 __-seed__ ''num''
317
318
319 Sets the seed for the random number generator to the integer
320 ''num''. The seed used to create each picture is
321 displayed on standard output (unless suppressed with the
322 __-quiet__ option). Pictures generated with the same seed
323 will be identical. If no __-seed__ is specified, a random
324 seed derived from the date and time will be chosen. Specify-
325 ing an explicit seed allows you to re-render a picture you
326 particularly like at a higher reso- lution or with different
327 viewing parameters.
328
329
330 __-stars__ ''fraction''
331
332
333 Specifies the percentage of pixels, in tenths of a percent,
334 which will appear as stars, either surrounding a planet or
335 filling the entire frame if __-night__ is specified. The
336 default ''fraction'' is 100.
337
338
339 __-xsize|-width__ ''width''
340
341
342 Sets the width of the generated image to ''width''
343 pixels. The default width is 256 pixels. Im- ages must be at
344 least as wide as they are high; if a width less than the
345 height is specified, it will be increased to equal the
346 height. If you must have a long skinny pixmap, make a square
347 one with __ppmforge__, then use __pnmcut__ to extract
348 a portion of the shape and size you require.
349
350
351 __-ysize|-height__ ''height''
352
353
354 Sets the height of the generated image to ''height''
355 pixels. The default height is 256 pixels. If the height
356 specified exceeds the width, the width will be increased to
357 equal the height.
358
359
360 All flags can be abbreviated to their shortest unique pre-
361 fix.
362 !!BUGS
363
364
365 The algorithms require the output pixmap to be at least as
366 wide as it is high, and the width to be an even number of
367 pixels. These constraints are enforced by increasing the
368 size of the requested pixmap if necessary.
369
370
371 You may have to reduce the FFT mesh size on machines with 16
372 bit integers and segmented pointer
373 architectures.
374 !!SEE ALSO
375
376
377 pnmcut(1), pnmdepth(1), ppmdither(1),
378 ppmquant(1), ppm(5)
379
380
381 [[1]
382
383
384 Voss, Richard F., ``Random Fractal Forgeries,'' in Earnshaw
385 et. al., Fundamental Algorithms for Computer Graphics,
386 Berlin: Springer-Verlag, 1985.
387
388
389 [[2]
390
391
392 Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal
393 Images, New York: Springer Verlag, 1988.
394 !!AUTHOR
395
396
397 John Walker
398 Autodesk SA
399 Avenue des Champs-Montants 14b
400 CH-2074 MARIN
401 Suisse/Schweiz/Svizzera/Svizra/Switzerland
402 Usenet:
403 kelvin@Autodesk.com
404 Fax:
405 038/33 88 15
406 Voice:
407 038/33 76 33
408
409
410 Permission to use, copy, modify, and distribute this soft-
411 ware and its documentation for any purpose and without fee
412 is hereby granted, without any conditions or restrictions.
413 This software is provided ``as is'' without express or im-
414 plied warranty.
415
416
417 __PLUGWARE!__ If you like this kind of stuff, you may
418 also enjoy ``James Gleick's Chaos--The Software'' for
419 MS-DOS, available for $59.95 from your local software store
420 or di- rectly from Autodesk, Inc., Attn: Science Series,
421 2320 Marinship Way, Sausalito, CA 94965, USA. Telephone:
422 (800) 688-2344 toll-free or, outside the U.S. (415) 332-2344
423 Ext 4886. Fax: (415) 289-4718. ``Chaos--The Software'' in-
424 cludes a more comprehensive fractal forgery generator which
425 creates three-dimensional landscapes as well as clouds and
426 planets, plus five more modules which explore other aspects
427 of Chaos. The user guide of more than 200 pages includes an
428 introduction by James Gleick and de- tailed explanations by
429 Rudy Rucker of the mathematics and algorithms used by each
430 program.
431 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.