552 lines
17 KiB
HTML
552 lines
17 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of ppmforge</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>ppmforge</H1>
|
|
Section: User Commands (1)<BR>Updated: 25 October 1991<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="ixAAB"></A>
|
|
<A NAME="ixAAC"></A>
|
|
<A NAME="ixAAD"></A>
|
|
<A NAME="ixAAE"></A>
|
|
<A NAME="ixAAF"></A>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ppmforge - fractal forgeries of clouds, planets, and starry skies
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
<B>ppmforge</B>
|
|
|
|
[<B>-clouds</B>]
|
|
|
|
|
|
[<B>-night</B>]
|
|
|
|
[<B>-dimension</B>
|
|
|
|
<I>dimen</I>]
|
|
|
|
[<B>-hour</B>
|
|
|
|
<I>hour</I>]
|
|
|
|
[<B>-inclination|-tilt</B>
|
|
|
|
<I>angle</I>]
|
|
|
|
[<B>-mesh</B>
|
|
|
|
<I>size</I>]
|
|
|
|
[<B>-power</B>
|
|
|
|
<I>factor</I>]
|
|
|
|
[<B>-glaciers</B>
|
|
|
|
<I>level</I>]
|
|
|
|
[<B>-ice</B>
|
|
|
|
<I>level</I>]
|
|
|
|
[<B>-saturation</B>
|
|
|
|
<I>sat</I>]
|
|
|
|
[<B>-seed</B>
|
|
|
|
<I>seed</I>]
|
|
|
|
[<B>-stars</B>
|
|
|
|
<I>fraction</I>]
|
|
|
|
[<B>-xsize|-width</B>
|
|
|
|
<I>width</I>]
|
|
|
|
[<B>-ysize|-height</B>
|
|
|
|
<I>height</I>]
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>ppmforge</B>
|
|
|
|
generates three kinds of ``random fractal forgeries,'' the term coined
|
|
by Richard F. Voss of the IBM Thomas J. Watson Research Center for
|
|
seemingly realistic pictures of natural objects generated by simple
|
|
algorithms embodying randomness and fractal self-similarity. The
|
|
techniques used by
|
|
<B>ppmforge</B>
|
|
|
|
are essentially those
|
|
given by Voss[1], particularly the technique of spectral synthesis
|
|
explained in more detail by Dietmar Saupe[2].
|
|
<P>
|
|
|
|
The program generates two varieties of pictures: planets and clouds,
|
|
which are just different renderings of data generated in an identical
|
|
manner, illustrating the unity of the fractal structure of these very
|
|
different objects. A third type of picture, a starry sky, is
|
|
synthesised directly from pseudorandom numbers.
|
|
<P>
|
|
|
|
The generation of planets or clouds begins with the preparation of an
|
|
array of random data in the frequency domain. The size of this
|
|
array, the ``mesh size,'' can be set with the
|
|
<B>-mesh</B>
|
|
|
|
option; the larger the mesh the more realistic the pictures but the
|
|
calculation time and memory requirement increases as the square of the
|
|
mesh size. The fractal dimension, which you can specify with the
|
|
<B>-dimension</B>
|
|
|
|
option, determines the roughness of the terrain on the planet or the
|
|
scale of detail in the clouds. As the fractal dimension is increased,
|
|
more high frequency components are added into the random mesh.
|
|
<P>
|
|
|
|
Once the mesh is generated, an inverse two dimensional Fourier
|
|
transform is performed upon it. This converts the original random
|
|
frequency domain data into spatial amplitudes. We scale the real
|
|
components that result from the Fourier transform into numbers from 0
|
|
to 1 associated with each point on the mesh. You can further
|
|
modify this number by applying a ``power law scale'' to it with the
|
|
<B>-power</B>
|
|
|
|
option. Unity scale
|
|
leaves the numbers unmodified; a power scale of 0.5 takes the square
|
|
root of the numbers in the mesh, while a power scale of 3 replaces the
|
|
numbers in the mesh with their cubes. Power law scaling is best
|
|
envisioned by thinking of the data as representing the elevation of
|
|
terrain; powers less than 1 yield landscapes with vertical scarps that
|
|
look like glacially-carved valleys; powers greater than one make
|
|
fairy-castle spires (which require large mesh sizes and high
|
|
resolution for best results).
|
|
<P>
|
|
|
|
After these calculations, we have a array of the specified size
|
|
containing numbers that range from 0 to 1. The pixmaps are generated as
|
|
follows:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>Clouds</B>
|
|
|
|
<DD>
|
|
A colour map is created that ranges from pure blue to white by
|
|
increasing admixture (desaturation) of blue with white. Numbers less
|
|
than 0.5 are coloured blue, numbers between 0.5 and 1.0 are coloured
|
|
with corresponding levels of white, with 1.0 being pure white.
|
|
<DT id="2"><B>Planet</B>
|
|
|
|
<DD>
|
|
The mesh is projected onto a sphere. Values less than 0.5 are treated
|
|
as water and values between 0.5 and 1.0 as land. The water areas are
|
|
coloured based upon the water depth, and land based on its elevation.
|
|
The random depth data are used to create clouds over the oceans. An
|
|
atmosphere approximately like the Earth's is simulated; its light
|
|
absorption is calculated to create a blue cast around the limb of the
|
|
planet. A function that rises from 0 to 1 based on latitude is
|
|
modulated by the local elevation to generate polar ice caps--high
|
|
altitude terrain carries glaciers farther from the pole. Based on the
|
|
position of the star with respect to the observer, the apparent colour
|
|
of each pixel of the planet is calculated by ray-tracing from the star
|
|
to the planet to the observer and applying a lighting model that sums
|
|
ambient light and diffuse reflection (for most planets ambient light
|
|
is zero, as their primary star is the only source of illumination).
|
|
Additional random data are used to generate stars around the planet.
|
|
<DT id="3"><B>Night</B>
|
|
|
|
<DD>
|
|
A sequence of pseudorandom numbers is used to generate stars with a
|
|
user specified density.
|
|
</DL>
|
|
<P>
|
|
|
|
Cloud pictures always contain 256 or fewer colours and may be
|
|
displayed on most colour mapped devices without further processing.
|
|
Planet pictures often contain tens of thousands of colours which
|
|
must be compressed with
|
|
<B>ppmquant</B>
|
|
|
|
or
|
|
<B>ppmdither</B>
|
|
|
|
before encoding in a colour mapped format. If the display resolution is
|
|
high enough,
|
|
<B>ppmdither</B>
|
|
|
|
generally produces better looking planets.
|
|
<B>ppmquant</B>
|
|
|
|
tends to create discrete colour bands, particularly in the oceans,
|
|
which are unrealistic and distracting. The number of colours in starry
|
|
sky pictures generated with the
|
|
<B>-night</B>
|
|
|
|
option depends on the value specified for
|
|
<B>-saturation</B>.
|
|
|
|
Small values limit the colour temperature distribution of the stars
|
|
and reduce the number of colours in the image.
|
|
If the
|
|
<B>-saturation</B>
|
|
|
|
is set to 0, none of the stars will be coloured and the resulting
|
|
image will never contain more than 256 colours.
|
|
Night sky pictures with many different star colours often look
|
|
best when colour compressed by
|
|
<B>pnmdepth</B>
|
|
|
|
rather than
|
|
<B>ppmquant</B>
|
|
|
|
or
|
|
<B>ppmdither</B>.
|
|
|
|
Try
|
|
<I>newmaxval</I>
|
|
|
|
settings of 63, 31, or 15 with
|
|
<B>pnmdepth</B>
|
|
|
|
to reduce the number of colours in the picture to 256 or fewer.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="4"><B>-clouds</B>
|
|
|
|
<DD>
|
|
Generate clouds. A pixmap of fractal clouds is generated. Selecting clouds
|
|
sets the default for fractal dimension to 2.15 and power scale factor
|
|
to 0.75.
|
|
<DT id="5"><B>-dimension</B><I> dimen</I>
|
|
|
|
<DD>
|
|
Sets the fractal dimension to the specified
|
|
<I>dimen</I>,
|
|
|
|
which may be any floating point value between 0 and 3. Higher fractal
|
|
dimensions create more ``chaotic'' images, which require higher
|
|
resolution output and a larger FFT mesh size to look good. If no
|
|
dimension is specified, 2.4 is used when generating planets and 2.15
|
|
for clouds.
|
|
<DT id="6"><B>-glaciers</B><I> level</I>
|
|
|
|
<DD>
|
|
The floating point
|
|
<I>level</I>
|
|
|
|
setting controls the extent to which terrain elevation causes ice to
|
|
appear at lower latitudes. The default value of 0.75 makes the polar
|
|
caps extend toward the equator across high terrain and forms glaciers
|
|
in the highest mountains, as on Earth. Higher values make ice sheets
|
|
that cover more and more of the land surface, simulating planets in the
|
|
midst of an ice age. Lower values tend to be boring, resulting in
|
|
unrealistic geometrically-precise ice cap boundaries.
|
|
<DT id="7"><B>-hour</B><I> hour</I>
|
|
|
|
<DD>
|
|
When generating a planet,
|
|
<I>hour</I>
|
|
|
|
is used as the ``hour angle at the central meridian.'' If you specify
|
|
<B>-hour 12</B>,
|
|
|
|
for example, the planet will be fully illuminated, corresponding to
|
|
high noon at the longitude at the centre of the screen. You can
|
|
specify any floating point value between 0 and 24 for
|
|
<I>hour</I>,
|
|
|
|
but values which place most of the planet in darkness (0 to 4 and 20
|
|
to 24) result in crescents which, while pretty, don't give you many
|
|
illuminated pixels for the amount of computing that's required. If no
|
|
<B>-hour</B>
|
|
|
|
option is specified, a random hour angle is chosen, biased so that
|
|
only 25% of the images generated will be crescents.
|
|
<DT id="8"><B>-ice</B><I> level</I>
|
|
|
|
<DD>
|
|
Sets the extent of the polar ice caps to the given floating point
|
|
<I>level</I>.
|
|
|
|
The default level of 0.4 produces ice caps similar to those of the Earth.
|
|
Smaller values reduce the amount of ice, while larger
|
|
<B>-ice</B>
|
|
|
|
settings create more prominent ice caps. Sufficiently large values,
|
|
such as 100 or more, in conjunction with small settings for
|
|
<B>-glaciers</B>
|
|
|
|
(try 0.1) create ``ice balls'' like Europa.
|
|
<DT id="9"><B>-inclination|-tilt</B><I> angle</I>
|
|
|
|
<DD>
|
|
The inclination angle of the planet with regard to its primary star is
|
|
set to
|
|
<I>angle</I>,
|
|
|
|
which can be any floating point value from -90 to 90. The inclination
|
|
angle can be thought of as specifying, in degrees, the ``season'' the
|
|
planet is presently experiencing or, more precisely, the latitude at
|
|
which the star transits the zenith at local noon. If 0, the planet
|
|
is at equinox; the star is directly overhead at the equator.
|
|
Positive values represent summer in the northern hemisphere, negative
|
|
values summer in the southern hemisphere. The Earth's inclination
|
|
angle, for example, is about 23.5 at the June solstice, 0 at the
|
|
equinoxes in March and September, and -23.5 at the December solstice.
|
|
If no inclination angle is specified, a random value between -21.6 and
|
|
21.6 degrees is chosen.
|
|
<DT id="10"><B>-mesh</B><I> size</I>
|
|
|
|
<DD>
|
|
A mesh of
|
|
<I>size</I> by <I>size</I>
|
|
|
|
will be used for the fast Fourier transform (FFT). Note that memory
|
|
requirements and computation speed increase as the square of
|
|
<I>size</I>;
|
|
|
|
if you double the mesh size, the program will use four times the
|
|
memory and run four times as long. The default mesh is 256x256, which
|
|
produces reasonably good looking pictures while using half a megabyte
|
|
for the 256x256 array of single precision complex numbers
|
|
required by the FFT. On machines with limited memory capacity, you
|
|
may have to reduce the mesh size to avoid running out of RAM.
|
|
Increasing the mesh size produces better looking pictures; the
|
|
difference becomes particularly noticeable when generating high
|
|
resolution images with relatively high fractal dimensions (between 2.2
|
|
and 3).
|
|
<DT id="11"><B>-night</B>
|
|
|
|
<DD>
|
|
A starry sky is generated. The stars are created by the same algorithm
|
|
used for the stars that surround planet pictures, but the output
|
|
consists exclusively of stars.
|
|
<DT id="12"><B>-power</B><I> factor</I>
|
|
|
|
<DD>
|
|
Sets the ``power factor'' used to scale elevations synthesised from
|
|
the FFT to
|
|
<I>factor</I>,
|
|
|
|
which can be any floating point number greater than zero. If no
|
|
factor is specified a default of 1.2 is used if a planet is being
|
|
generated, or 0.75 if clouds are selected by the
|
|
<B>-clouds</B>
|
|
|
|
option. The result of the FFT image synthesis is an array of elevation
|
|
values between 0 and 1. A non-unity power factor exponentiates each
|
|
of these elevations to the specified power. For example, a power
|
|
factor of 2 squares each value, while a power factor of 0.5 replaces
|
|
each with its square root. (Note that exponentiating values between 0
|
|
and 1 yields values that remain within that range.) Power factors
|
|
less than 1 emphasise large-scale elevation changes at the expense of
|
|
small variations. Power factors greater than 1 increase the roughness
|
|
of the terrain and, like high fractal dimensions, may require a larger
|
|
FFT mesh size and/or higher screen resolution to look good.
|
|
<DT id="13"><B>-saturation</B><I> sat</I>
|
|
|
|
<DD>
|
|
Controls the degree of colour saturation of the stars that surround planet
|
|
pictures and fill starry skies created with the
|
|
<B>-night</B>
|
|
|
|
option. The default value of 125 creates stars which resemble the sky
|
|
as seen by the human eye from Earth's surface. Stars are dim; only
|
|
the brightest activate the cones in the human retina, causing colour
|
|
to be perceived. Higher values of
|
|
<I>sat</I>
|
|
|
|
approximate the appearance of stars from Earth orbit, where better
|
|
dark adaptation, absence of skyglow, and the concentration of light
|
|
from a given star onto a smaller area of the retina thanks to the lack
|
|
of atmospheric turbulence enhances the perception of colour. Values
|
|
greater than 250 create ``science fiction'' skies that, while pretty,
|
|
don't occur in this universe.
|
|
<DT id="14"> <DD>
|
|
Thanks to the inverse square law combined with Nature's love of
|
|
mediocrity, there are many, many dim stars for every bright one.
|
|
This population relationship is accurately reflected in the skies
|
|
created by
|
|
<B>ppmforge</B>.
|
|
|
|
Dim, low mass stars live much longer than bright massive stars,
|
|
consequently there are many reddish stars for every blue giant. This
|
|
relationship is preserved by
|
|
<B>ppmforge</B>.
|
|
|
|
You can reverse the proportion, simulating the sky as seen in a starburst
|
|
galaxy, by specifying a negative
|
|
<I>sat</I>
|
|
|
|
value.
|
|
<DT id="15"><B>-seed</B><I> num</I>
|
|
|
|
<DD>
|
|
Sets the seed for the random number generator to the integer
|
|
<I>num</I>.
|
|
|
|
The seed used to create each picture is displayed on standard output (unless
|
|
suppressed with the
|
|
<B>-quiet</B>
|
|
|
|
option). Pictures generated with the same seed will be identical. If no
|
|
<B>-seed</B>
|
|
|
|
is specified, a random seed derived from the date and time will be
|
|
chosen. Specifying an explicit seed allows you to re-render a picture
|
|
you particularly like at a higher resolution or with different viewing
|
|
parameters.
|
|
<DT id="16"><B>-stars</B><I> fraction</I>
|
|
|
|
<DD>
|
|
Specifies the percentage of pixels, in tenths of a percent, which will
|
|
appear as stars, either surrounding a planet or filling the entire
|
|
frame if
|
|
<B>-night</B>
|
|
|
|
is specified. The default
|
|
<I>fraction</I>
|
|
|
|
is 100.
|
|
<DT id="17"><B>-xsize|-width</B><I> width</I>
|
|
|
|
<DD>
|
|
Sets the width of the generated image to
|
|
<I>width</I>
|
|
|
|
pixels. The default width is 256 pixels. Images must be at least as
|
|
wide as they are high; if a width less than the height is specified,
|
|
it will be increased to equal the height. If you must have a long
|
|
skinny pixmap, make a square one with
|
|
<B>ppmforge</B>,
|
|
|
|
then use
|
|
<B>pnmcut</B>
|
|
|
|
to extract a portion of the shape and size you require.
|
|
<DT id="18"><B>-ysize|-height</B><I> height</I>
|
|
|
|
<DD>
|
|
Sets the height of the generated image to
|
|
<I>height</I>
|
|
|
|
pixels. The default height is 256 pixels. If the height specified
|
|
exceeds the width, the width will be increased to equal the height.
|
|
</DL>
|
|
<P>
|
|
|
|
All flags can be abbreviated to their shortest unique prefix.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
<P>
|
|
|
|
The algorithms require the output pixmap to be at least as wide as it
|
|
is high, and the width to be an even number of pixels. These
|
|
constraints are enforced by increasing the size of the requested
|
|
pixmap if necessary.
|
|
<P>
|
|
|
|
You may have to reduce the FFT mesh size on machines with 16 bit
|
|
integers and segmented pointer architectures.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+pnmcut">pnmcut</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+pnmdepth">pnmdepth</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ppmdither">ppmdither</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ppmquant">ppmquant</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+ppm">ppm</A></B>(5)
|
|
|
|
<DL COMPACT>
|
|
<DT id="19">[1] <DD>
|
|
Voss, Richard F., ``Random Fractal Forgeries,'' in Earnshaw
|
|
et. al., Fundamental Algorithms for Computer Graphics, Berlin:
|
|
Springer-Verlag, 1985.
|
|
<DT id="20">[2]<DD>
|
|
Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images,
|
|
New York: Springer Verlag, 1988.
|
|
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
<DL COMPACT><DT id="21"><DD>
|
|
<PRE>
|
|
John Walker
|
|
Autodesk SA
|
|
Avenue des Champs-Montants 14b
|
|
CH-2074 MARIN
|
|
Suisse/Schweiz/Svizzera/Svizra/Switzerland
|
|
<DL COMPACT>
|
|
<DT id="22">Usenet:<DD><A HREF="mailto:kelvin@Autodesk.com">kelvin@Autodesk.com</A>
|
|
<DT id="23">Fax:<DD>038/33 88 15
|
|
<DT id="24">Voice:<DD>038/33 76 33
|
|
</PRE>
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
|
|
<P>
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
documentation for any purpose and without fee is hereby granted,
|
|
without any conditions or restrictions. This software is provided ``as
|
|
is'' without express or implied warranty.
|
|
<P>
|
|
|
|
<B>PLUGWARE!</B>
|
|
|
|
If you like this kind of stuff, you may also enjoy ``James Gleick's
|
|
Chaos--The Software'' for MS-DOS, available for $59.95 from your
|
|
local software store or directly from Autodesk, Inc., Attn: Science
|
|
Series, 2320 Marinship Way, Sausalito, CA 94965, USA. Telephone:
|
|
(800) 688-2344 toll-free or, outside the U.S. (415) 332-2344 Ext
|
|
4886. Fax: (415) 289-4718. ``Chaos--The Software'' includes a more
|
|
comprehensive fractal forgery generator which creates
|
|
three-dimensional landscapes as well as clouds and planets, plus five
|
|
more modules which explore other aspects of Chaos. The user guide of
|
|
more than 200 pages includes an introduction by James Gleick and
|
|
detailed explanations by Rudy Rucker of the mathematics and algorithms
|
|
used by each program.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="25"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="26"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="27"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="28"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="29"><A HREF="#lbAF">BUGS</A><DD>
|
|
<DT id="30"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="31"><A HREF="#lbAH">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:24 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|