{
    "mode": "man",
    "parameter": "pgmcrater",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pgmcrater/1/json",
    "generated": "2026-06-16T10:11:07Z",
    "synopsis": "pgmcrater [-number n] [-height|-ysize s] [-width|-xsize s] [-gamma g]\nAll options can be abbreviated to their shortest unique prefix.",
    "sections": {
        "NAME": {
            "content": "pgmcrater - create cratered terrain by fractal forgery\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pgmcrater [-number n] [-height|-ysize s] [-width|-xsize s] [-gamma g]\n\nAll options can be abbreviated to their shortest unique prefix.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pgmcrater  creates  a  PGM  image which mimics cratered terrain.  The PGM image is created by\nsimulating the impact of a given number of craters with random position and size,  then  ren-\ndering  the resulting terrain elevations based on a light source shining from one side of the\nscreen.  The size distribution of the craters is based on a power law which results  in  many\nmore  small craters than large ones.  The number of craters of a given size varies as the re-\nciprocal of the area as described on pages 31 and 32 of Peitgen and Saupe[1]; cratered bodies\nin  the  Solar  System  are  observed  to obey this relationship.  The formula used to obtain\ncrater radii governed by this law from a uniformly distributed pseudorandom sequence was  de-\nveloped by Rudy Rucker.\n\nHigh  resolution  images with large numbers of craters often benefit from being piped through\npnmsmooth.  The averaging performed by this process eliminates some of the jagged pixels  and\nlends a mellow ``telescopic image'' feel to the overall picture.\n\npgmcrater  simulates  only small craters, which are hemispherical in shape (regardless of the\nincidence angle of the impacting body, as long as the velocity is sufficiently high).   Large\ncraters,  such  as  Copernicus  and  Tycho  on the Moon, have a ``walled plain'' shape with a\ncross-section more like:\n/\\                            /\\\n/  \\/\\/  \\\nLarger craters should really use this profile, including the central peak, and totally oblit-\nerate the pre-existing terrain.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-number n Causes  n  craters  to  be  generated.  If no -number specification is given, 50000\ncraters will be generated.  Don't expect to see them all!  For every  large  crater\nthere  are  many, many more tiny ones which tend simply to erode the landscape.  In\ngeneral, the more craters you specify the more realistic the  result;  ideally  you\nwant  the  entire  terrain  to have been extensively turned over again and again by\ncratering.  High resolution images containing five to ten million craters are stun-\nning but take quite a while to create.\n\n-height height\nSets the height of the generated image to height pixels.  The default height is 256\npixels.\n\n-width width\nSets the width of the generated image to width pixels.  The default  width  is  256\npixels.\n\n-xsize width\nSets  the  width  of the generated image to width pixels.  The default width is 256\npixels.\n\n-ysize height\nSets the height of the generated image to height pixels.  The default height is 256\npixels.\n\n-gamma factor\nThe  specified  factor is used to gamma adjust the image in the same manner as per-\nformed by pnmgamma.  The default value is 1.0, which results in a  medium  contrast\nimage.   Values  larger  than 1 lighten the image and reduce contrast, while values\nless than 1 darken the image, increasing contrast.\n\nNote that this is separate from the gamma correction that is part of the definition\nof  the PGM format.  The image pnmgamma generates is a genuine, gamma-corrected PGM\nimage in any case.  This option simply changes the contrast and may compensate  for\na display device that does not correctly render PGM images.\n",
            "subsections": []
        },
        "DESIGN NOTES": {
            "content": "The  -gamma option isn't really necessary since you can achieve the same effect by piping the\noutput from pgmcrater through pnmgamma.  However, pgmcrater performs an  internal  gamma  map\nanyway in the process of rendering the elevation array into the PGM format, so there's no ad-\nditional overhead in allowing an additional gamma adjustment.\n\nReal craters have two distinct morphologies.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pgm(5), pnmgamma(1), pnmsmooth(1)\n\n[1]  Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images,  New  York:  Springer\nVerlag, 1988.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "John Walker\nAutodesk SA\nAvenue des Champs-Montants 14b\nCH-2074 MARIN\nSuisse/Schweiz/Svizzera/Svizra/Switzerland\nUsenet:  kelvin@Autodesk.com\nFax:     038/33 88 15\nVoice:   038/33 76 33\n\nPermission  to  use, copy, modify, and distribute this software and its documentation for any\npurpose and without fee is hereby granted, without  any  conditions  or  restrictions.   This\nsoftware is provided ``as is'' without express or implied warranty.\n\nPLUGWARE!   If  you  like  this kind of stuff, you may also enjoy ``James Gleick's Chaos--The\nSoftware'' for MS-DOS, available for $59.95 from your local software store or  directly  from\nAutodesk,  Inc.,  Attn:  Science Series, 2320 Marinship Way, Sausalito, CA 94965, USA.  Tele-\nphone: (800) 688-2344 toll-free or, outside the U.S. (415) 332-2344  Ext  4886.   Fax:  (415)\n289-4718.   ``Chaos--The  Software''  includes a more comprehensive fractal forgery generator\nwhich creates three-dimensional landscapes as well as clouds and planets, plus five more mod-\nules which explore other aspects of Chaos.  The user guide of more than 200 pages includes an\nintroduction by James Gleick and detailed explanations by Rudy Rucker of the mathematics  and\nalgorithms used by each program.\n\n15 October 1991                             pgmcrater(1)",
            "subsections": []
        }
    },
    "summary": "pgmcrater - create cratered terrain by fractal forgery",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "pgm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pgm/5/json"
        },
        {
            "name": "pnmgamma",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmgamma/1/json"
        },
        {
            "name": "pnmsmooth",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmsmooth/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "This command has been superseded by `pamcrater`, `pamshadedrelief`, and `pamtopnm`.",
        "examples": [
            {
                "description": "View documentation for `pamcrater`",
                "command": "tldr pamcrater"
            },
            {
                "description": "View documentation for `pamshadedrelief`",
                "command": "tldr pamshadedrelief"
            },
            {
                "description": "View documentation for `pamtopnm`",
                "command": "tldr pamtopnm"
            }
        ]
    }
}