1Ppmforge User Manual(0)                                Ppmforge User Manual(0)
2
3
4

NAME

6       ppmforge - fractal forgeries of clouds, planets, and starry skies
7

SYNOPSIS

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

DESCRIPTION

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       The randomness in the image is limited before  Netpbm  10.37  (December
63       2006)  --  if you run the program twice in the same second, you may get
64       identical output.
65
66
67
68       Clouds A color map is created that ranges from pure blue  to  white  by
69              increasing admixture (desaturation) of blue with white.  Numbers
70              less than 0.5 are colored blue, numbers between 0.5 and 1.0  are
71              colored  with corresponding levels of white, with 1.0 being pure
72              white.
73
74
75       Planet The mesh is projected onto a sphere.  Values less than  0.5  are
76              treated  as  water  and values between 0.5 and 1.0 as land.  The
77              water areas are colored based upon the  water  depth,  and  land
78              based  on its elevation.  The random depth data are used to cre‐
79              ate clouds over the oceans.  An  atmosphere  approximately  like
80              the  Earth's is simulated; its light absorption is calculated to
81              create a blue cast around the limb of the  planet.   A  function
82              that  rises  from  0  to 1 based on latitude is modulated by the
83              local elevation to generate polar ice caps--high  altitude  ter‐
84              rain carries glaciers farther from the pole.  Based on the posi‐
85              tion of the star with respect  to  the  observer,  the  apparent
86              color  of  each pixel of the planet is calculated by ray-tracing
87              from the star to the planet  to  the  observer  and  applying  a
88              lighting  model  that  sums ambient light and diffuse reflection
89              (for most planets ambient light is zero, as their  primary  star
90              is the only source of illumination).  Additional random data are
91              used to generate stars around the planet.
92
93
94       Night  A sequence of pseudorandom numbers is  used  to  generate  stars
95              with a user specified density.
96
97
98       Cloud  pictures always contain 256 or fewer colors and may be displayed
99       on most color mapped devices without further processing.   Planet  pic‐
100       tures  often  contain  tens  of  thousands of colors which must be com‐
101       pressed with pnmquant or ppmdither before encoding in  a  color  mapped
102       format.   If the display resolution is high enough, ppmdither generally
103       produces better looking planets.  pnmquant  tends  to  create  discrete
104       color bands, particularly in the oceans, which are unrealistic and dis‐
105       tracting.  The number of colors in starry sky pictures  generated  with
106       the  -night  option  depends  on  the  value specified for -saturation.
107       Small values limit the color temperature distribution of the stars  and
108       reduce the number of colors in the image.  If the -saturation is set to
109       0, none of the stars will be colored and the resulting image will never
110       contain  more  than 256 colors.  Night sky pictures with many different
111       star colors often look best when color compressed  by  pamdepth  rather
112       than  pnmquant  or  ppmdither.  Try newmaxval settings of 63, 31, or 15
113       with pamdepth to reduce the number of colors in the picture to  256  or
114       fewer.
115
116
117

OPTIONS

119       You can abbreviate any options to its shortest unique prefix.
120
121
122
123       -clouds
124              Generate  clouds.   An  image  of  fractal  clouds is generated.
125              Selecting clouds sets the default for fractal dimension to  2.15
126              and power scale factor to 0.75.
127
128
129       -dimension dimen
130               Sets the fractal dimension to the specified dimen, which may be
131              any floating point value between 0 and 3.  Higher fractal dimen‐
132              sions create more ``chaotic'' images, which require higher reso‐
133              lution output and a larger FFT mesh size to look  good.   If  no
134              dimension  is specified, 2.4 is used when generating planets and
135              2.15 for clouds.
136
137
138       -glaciers level
139              The floating point level setting controls the  extent  to  which
140              terrain  elevation causes ice to appear at lower latitudes.  The
141              default value of 0.75 makes the polar  caps  extend  toward  the
142              equator  across  high  terrain and forms glaciers in the highest
143              mountains, as on Earth.  Higher  values  make  ice  sheets  that
144              cover  more  and more of the land surface, simulating planets in
145              the midst of an ice  age.   Lower  values  tend  to  be  boring,
146              resulting  in  unrealistic  geometrically-precise ice cap bound‐
147              aries.
148
149
150       -hour hour
151              When generating a planet, ppmforge uses hour as the "hour  angle
152              at the central meridian."  If you specify -hour 12, for example,
153              the planet will be fully illuminated, corresponding to high noon
154              at  the  longitude at the center of the screen.  You can specify
155              any floating point value between 0 and 24 for hour,  but  values
156              which place most of the planet in darkness (0 to 4 and 20 to 24)
157              result in crescents which, while pretty,  don't  give  you  many
158              illuminated  pixels for the amount of computing that's required.
159              If no -hour option is specified, a random hour angle is  chosen,
160              biased  so  that  only 25% of the images generated will be cres‐
161              cents.
162
163
164       -ice level
165              Sets the extent of the polar ice  caps  to  the  given  floating
166              point level.  The default level of 0.4 produces ice caps similar
167              to those of the Earth.  Smaller values reduce the amount of ice,
168              while larger -ice settings create more prominent ice caps.  Suf‐
169              ficiently large values, such as 100 or more, in conjunction with
170              small  settings  for -glaciers (try 0.1) create "ice balls" like
171              Europa.
172
173
174       -inclination|-tilt angle
175              The inclination angle of the planet with regard to  its  primary
176              star is set to angle, which can be any floating point value from
177              -90 to 90.  The inclination angle can be thought of as  specify‐
178              ing,  in degrees, the ``season'' the planet is presently experi‐
179              encing or, more precisely, the latitude at which the star  tran‐
180              sits  the zenith at local noon.  If 0, the planet is at equinox;
181              the star is directly overhead at the equator.   Positive  values
182              represent  summer  in  the  northern hemisphere, negative values
183              summer in the  southern  hemisphere.   The  Earth's  inclination
184              angle, for example, is about 23.5 at the June solstice, 0 at the
185              equinoxes in March and September, and -23.5 at the December sol‐
186              stice.   If  no  inclination  angle is specified, a random value
187              between -21.6 and 21.6 degrees is chosen.
188
189
190       -mesh size
191              A mesh of size by size will be used for the fast Fourier  trans‐
192              form (FFT).  Note that memory requirements and computation speed
193              increase as the square of size; if you double the mesh size, the
194              program  will  use  four  times the memory and run four times as
195              long.  The default mesh is 256x256,  which  produces  reasonably
196              good  looking  pictures  while  using  half  a  megabyte for the
197              256x256 array of single precision complex  numbers  required  by
198              the FFT.  On machines with limited memory capacity, you may have
199              to reduce the mesh size to avoid running out of RAM.  Increasing
200              the  mesh  size produces better looking pictures; the difference
201              becomes particularly noticeable when generating high  resolution
202              images  with relatively high fractal dimensions (between 2.2 and
203              3).
204
205
206       -night A starry sky is generated.  The stars are created  by  the  same
207              algorithm  used for the stars that surround planet pictures, but
208              the output consists exclusively of stars.
209
210
211       -power factor
212              Sets the "power factor" used  to  scale  elevations  synthesised
213              from  the  FFT to factor, which can be any floating point number
214              greater than zero.  If no factor is specified a default  of  1.2
215              is  used  if  a planet is being generated, or 0.75 if clouds are
216              selected by the -clouds option.  The result  of  the  FFT  image
217              synthesis  is  an  array of elevation values between 0 and 1.  A
218              non-unity power factor exponentiates each of these elevations to
219              the  specified  power.  For example, a power factor of 2 squares
220              each value, while a power factor of 0.5 replaces each  with  its
221              square  root.   (Note that exponentiating values between 0 and 1
222              yields values that remain within  that  range.)   Power  factors
223              less  than  1  emphasise  large-scale  elevation  changes at the
224              expense of small  variations.   Power  factors  greater  than  1
225              increase  the  roughness  of  the terrain and, like high fractal
226              dimensions, may require a larger FFT  mesh  size  and/or  higher
227              screen resolution to look good.
228
229
230       -saturation sat
231              Controls  the  degree of color saturation of the stars that sur‐
232              round planet pictures and fill starry  skies  created  with  the
233              -night  option.   The  default  value of 125 creates stars which
234              resemble the sky as seen by the human eye from Earth's  surface.
235              Stars  are  dim;  only  the  brightest activate the cones in the
236              human retina, causing color to be perceived.  Higher  values  of
237              sat  approximate the appearance of stars from Earth orbit, where
238              better dark adaptation, absence of skyglow, and  the  concentra‐
239              tion  of  light  from  a  given  star onto a smaller area of the
240              retina thanks to the lack of atmospheric turbulence enhances the
241              perception  of  color.  Values greater than 250 create ``science
242              fiction'' skies that, while pretty, don't  occur  in  this  uni‐
243              verse.
244
245              Thanks  to the inverse square law combined with Nature's love of
246              mediocrity, there are many, many dim stars for every bright one.
247              This  population  relationship  is  accurately  reflected in the
248              skies created by ppmforge.  Dim, low mass stars live much longer
249              than  bright  massive stars, consequently there are many reddish
250              stars for every blue giant.  This relationship is  preserved  by
251              ppmforge.  You can reverse the proportion, simulating the sky as
252              seen in a starburst galaxy, by specifying a negative sat value.
253
254
255       -seed num
256              Sets the seed for the random number  generator  to  the  integer
257              num.  The seed used to create each picture is displayed on stan‐
258              dard output (unless suppressed with the  -quiet  option).   Pic‐
259              tures  generated  with  the  same seed will be identical.  If no
260              -seed is specified, a random seed derived from the date and time
261              will  be  chosen.  Specifying an explicit seed allows you to re-
262              render a picture you particularly like at a higher resolution or
263              with different viewing parameters.
264
265
266       -stars fraction
267              Specifies  the  percentage  of  pixels,  in tenths of a percent,
268              which will appear as stars, either surrounding a planet or fill‐
269              ing  the entire frame if -night is specified.  The default frac‐
270              tion is 100.
271
272
273       -xsize|-width width
274              Sets the width of the generated  image  to  width  pixels.   The
275              default width is 256 pixels.  Images must be at least as wide as
276              they are high; if a width less than the height is specified,  it
277              will  be increased to equal the height.  If you must have a long
278              skinny image, make a square one with ppmforge, then  use  pamcut
279              to extract a portion of the shape and size you require.
280
281
282       -ysize|-height height
283              Sets  the  height  of the generated image to height pixels.  The
284              default height is 256 pixels.  If the height  specified  exceeds
285              the width, the width will be increased to equal the height.
286
287
288
289

LIMITATIONS

291       The algorithms require the output image to be at least as wide as it is
292       high, and the width to be an even number of pixels.  These  constraints
293       are  enforced  by  increasing the size of the requested image if neces‐
294       sary.
295
296       You may have to reduce the FFT mesh size on machines with 16 bit  inte‐
297       gers and segmented pointer architectures.
298
299

SEE ALSO

301       pamcut(1), pamdepth(1), ppmdither(1), pnmquant(1), ppm(1)
302
303
304
305       [1]    Voss,  Richard F., ``Random Fractal Forgeries,'' in Earnshaw et.
306              al.,  Fundamental  Algorithms  for  Computer  Graphics,  Berlin:
307              Springer-Verlag, 1985.
308
309
310       [2]    Peitgen,  H.-O.,  and  Saupe,  D.  eds.,  The Science Of Fractal
311              Images, New York: Springer Verlag, 1988.
312
313
314
315

AUTHOR

317       John Walker
318       Autodesk SA
319       Avenue des Champs-Montants 14b
320       CH-2074 MARIN
321       Suisse/Schweiz/Svizzera/Svizra/Switzerland
322           Usenet:kelvin@Autodesk.com
323           Fax:038/33 88 15
324           Voice:038/33 76 33
325
326       Permission to use, copy, modify, and distribute this software  and  its
327       documentation  for any purpose and without fee is hereby granted, with‐
328       out any conditions or restrictions.  This  software  is  provided  ``as
329       is'' without express or implied warranty.
330
331
332   PLUGWARE!
333       If  you  like  this  kind of stuff, you may also enjoy ``James Gleick's
334       Chaos--The Software'' for MS-DOS, available for $59.95 from your  local
335       software  store  or directly from Autodesk, Inc., Attn: Science Series,
336       2320  Marinship  Way,  Sausalito,  CA  94965,  USA.   Telephone:  (800)
337       688-2344  toll-free or, outside the U.S. (415) 332-2344 Ext 4886.  Fax:
338       (415) 289-4718.  ``Chaos--The Software'' includes a more  comprehensive
339       fractal forgery generator which creates three-dimensional landscapes as
340       well as clouds and planets, plus five more modules which explore  other
341       aspects  of  Chaos.   The user guide of more than 200 pages includes an
342       introduction by James Gleick and detailed explanations by  Rudy  Rucker
343       of the mathematics and algorithms used by each program.
344

DOCUMENT SOURCE

346       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
347       source.  The master documentation is at
348
349              http://netpbm.sourceforge.net/doc/ppmforge.html
350
351netpbm documentation            25 October 1991        Ppmforge User Manual(0)
Impressum