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

LIMITATIONS

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

SEE ALSO

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

AUTHOR

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

DOCUMENT SOURCE

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