PPMFORGE(1)
β¨ Ppmforge User Manual β¨
okay so bestie, this is the manual page for ppmforge, from the Netpbm family β part of Netpbm(1) fr fr π
π NAME π
ppmforge β fractal forgeries of clouds, planets, and starry skies πͺβοΈπ
π SYNOPSIS π
ppmforge
[-clouds] [-night] [-dimension dimen] [-hour hour] [-inclination|-tilt
angle] [-mesh size] [-power factor] [-glaciers level] [-ice level]
[-saturation sat] [-seed seed] [-stars fraction] [{-xsize|-width} width]
[{-ysize|-height} height]
yeah that's a LOT of little knobs and levers, and every single one of them is doing something. no filler. π
πΈ DESCRIPTION πΈ
This program is part of Netpbm(1).
so ppmforge makes three whole kinds of "random fractal forgeries" β and yes that's a real term, coined by Richard F. Voss of the IBM Thomas J. Watson Research Center, for pictures of natural objects that look legit realistic but are actually generated by the simplest little algorithms embodying randomness and fractal self-similarity. iconic behavior honestly. the techniques ppmforge uses are essentially those given by Voss[1], especially the technique of spectral synthesis, which is explained in more detail by Dietmar Saupe[2]. iykyk π§
The program generates two varieties of pictures: planets and clouds β which are literally just different renderings of data generated in an identical manner. (the way that proves the unity of the fractal structure of these very different objects?? obsessed.) and then there's a third type of picture: a starry sky, which is synthesised directly from pseudorandom numbers. no middleman. π«
π¦ how the fractal magic actually happens π¦
Generating planets or clouds starts with prepping an array of random data in the frequency domain. its size β the "mesh size" β is settable with the -mesh option. the larger the mesh, the more realistic the pictures, BUT the calculation time and memory requirement increase as the square of the mesh size. so yeah. that escalates fast, bestie π
The fractal dimension, which you can specify with the -dimension 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 get added into the random mesh. more chaos, more detail, periodt.
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, one per point on the mesh.
You can further modify this number by applying a "power law scale" to it with the -power option:
- unity scale β leaves the numbers unmodified
- a power scale of
0.5β takes the square root of the numbers in the mesh - 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. so:
- powers less than 1 β landscapes with vertical scarps that look like glacially-carved valleys ποΈ
- powers greater than one β fairy-castle spires π° (which require large mesh sizes and high resolution for best results, ngl)
After all these calculations, we have an array of the specified size containing numbers that range from 0 to 1. and then ppmforge generates as follows:
β οΈ heads up: The randomness in the image is limited before Netpbm 10.37 (December 2006) β if you run the program twice in the same second, you may get identical output. so if you're on something ancient, that's why your "random" pics are twinning π
βοΈ Clouds βοΈ
A color map is created that ranges from pure blue to white by increasing admixture (desaturation) of blue with white.
- numbers less than
0.5β colored blue - numbers between
0.5and1.0β colored with corresponding levels of white 1.0β pure white π€
πͺ Planet πͺ
The mesh is projected onto a sphere. π
- values less than
0.5β treated as water - values between
0.5and1.0β treated as land
The water areas are colored 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 color 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 β main character energy, honestly βοΈ)
Additional random data are used to generate stars around the planet. β
π Night π
A sequence of pseudorandom numbers is used to generate stars with a user specified density. thats it, thats the vibe. β¨
π«Ά color talk (important, don't skip) π«Ά
Cloud pictures always contain 256 or fewer colors and may be displayed on most color mapped devices without further processing. slay.
Planet pictures often contain tens of thousands of colors β which must be compressed with pnmquant or ppmdither before encoding in a color mapped format. if the display resolution is high enough, ppmdither generally produces better looking planets. pnmquant tends to create discrete color bands, particularly in the oceans, which are unrealistic and distracting π
The number of colors in starry sky pictures generated with the -night option depends on the value specified for -saturation. Small values limit the color temperature distribution of the stars and reduce the number of colors in the image. If the -saturation is set to 0, none of the stars will be colored and the resulting image will never contain more than 256 colors.
Night sky pictures with many different star colors often look best when color compressed by pamdepth rather than pnmquant or ppmdither. Try newmaxval settings of 63, 31, or 15 with pamdepth to reduce the number of colors in the picture to 256 or fewer. π
β¨ OPTIONS β¨
okay so first things first, bestie: ppmforge also gets all the options common to every libnetpbm program (the big one being -quiet, peep the Common Options section), and on top of that it recognizes these iconic command line options:
You can abbreviate any option to its shortest unique prefix. periodt β¨
-cloudsβ Generate clouds, literally. An image of fractal clouds is generated. Selecting clouds sets the default for fractal dimension to2.15and power scale factor to0.75.-dimensiondimen β Sets the fractal dimension to the specifieddimen, which may be any real number between0and5inclusive. 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, the program uses2.4when generating planets and2.15for clouds.-glacierslevel β The floating pointlevelsetting controls the extent to which terrain elevation causes ice to appear at lower latitudes. The default value of0.75makes 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.-hourhour β When generating a planet,ppmforgeuseshouras the "hour angle at the central meridian." If you specify-hour 12, for example, the planet will be fully illuminated, corresponding to high noon at the longitude at the center of the screen. You can specify any floating point value between0and24forhour, but values which place most of the planet in darkness (0to4and20to24) result in crescents which, while pretty, don't give you many illuminated pixels for the amount of computing that's required. If no-houroption is specified, a random hour angle is chosen, biased so that only25%of the images generated will be crescents.-icelevel β Sets the extent of the polar ice caps to the given floating pointlevel. The default level of0.4produces ice caps similar to those of the Earth. Smaller values reduce the amount of ice, while larger-icesettings create more prominent ice caps. Sufficiently large values, such as100or more, in conjunction with small settings for-glaciers(try0.1) create "ice balls" like Europa.-inclination|-tiltangle β The inclination angle of the planet with regard to its primary star is set toangle, which can be any floating point value from-90to90. The inclination angle can be thought of as specifying, in degrees, the ``season'' the planet is currently experiencing or, more precisely, the latitude at which the star transits the zenith at local noon. If0, 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 about23.5at the June solstice,0at the equinoxes in March and September, and-23.5at the December solstice. If no inclination angle is specified, a random value between-21.6and21.6degrees is chosen.-meshsize β A mesh ofsizebysizewill be used for the fast Fourier transform (FFT). Note that memory requirements and computation speed increase as the square ofsize; if you double the mesh size, the program will use four times the memory and run four times as long. The default mesh is256x256, which produces reasonably good looking pictures while using half a megabyte for the256x256array 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 (between2.2and3).-nightβ 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.-powerfactor β Sets the "power factor" used to scale elevations synthesised from the FFT tofactor, which can be any floating point number greater than zero. If nofactoris specified a default of1.2is used if a planet is being generated, or0.75if clouds are selected by the-cloudsoption. The result of the FFT image synthesis is an array of elevation values between0and1. A non-unity power factor exponentiates each of these elevations to the specified power. For example, a power factor of2squares each value, while a power factor of0.5replaces each with its square root. (Note that exponentiating values between0and1yields values that remain within that range.) Power factors less than1emphasise large-scale elevation changes at the expense of small variations. Power factors greater than1increase 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.-saturationsat β Controls the degree of color saturation of the stars that surround planet pictures and fill starry skies created with the-nightoption. The default value of125creates 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 color to be perceived. Higher values ofsatapproximate 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 color. Values greater than250create ``science fiction'' skies that, while pretty, don't occur in this universe.
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 ppmforge. 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 ppmforge. You can reverse the proportion, simulating the sky as seen in a starburst galaxy, by specifying a negative sat value.
-seednum β Sets the seed for the random number generator to the integernum. The seed used to create each picture is displayed on standard output (unless suppressed with the-quietoption). Pictures generated with the same seed will be identical. If no-seedis 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.-starsfraction β 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-nightis specified. The defaultfractionis100.-xsize|-widthwidth β Sets the width of the generated image towidthpixels. The default width is256pixels. 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 image, make a square one withppmforge, then usepamcutto extract a portion of the shape and size you require.-ysize|-heightheight β Sets the height of the generated image toheightpixels. The default height is256pixels. If the height specified exceeds the width, the width will be increased to equal the height.
π§ LIMITATIONS π§
The algorithms require the output image 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 image if necessary.
You may have to reduce the FFT mesh size on machines with 16 bit integers and segmented pointer architectures.
π SEE ALSO π
pamcut(1),pamdepth(1),ppmdither(1),pnmquant(1),ppm(1)
- [1] Voss, Richard F., ``Random Fractal Forgeries,'' in Earnshaw et. al., Fundamental Algorithms for Computer Graphics, Berlin: Springer-Verlag, 1985.
- [2] Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images, New York: Springer Verlag, 1988.
βοΈ AUTHOR βοΈ
- John Walker
- Autodesk SA
- Avenue des Champs-Montants 14b
- CH-2074 MARIN
- Suisse/Schweiz/Svizzera/Svizra/Switzerland
- Usenet:kelvin@Autodesk.com
- Fax:038/33 88 15
- Voice:038/33 76 33
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.
π PLUGWARE! π
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.
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/ppmforge.html
And that's the tea, bestie! This was the netpbm documentation, dated 27 March 2021 β the Ppmforge User Manual(1). Stay fractal, stay iconic! ππ¦β¨
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms