{
    "mode": "man",
    "parameter": "pnmsmooth",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pnmsmooth/1/json",
    "generated": "2026-10-05T02:16:27Z",
    "synopsis": "pnmsmooth [-width=cols] [-height=rows] [pnmfile] [-size]\nMinimum unique abbreviations of options is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.",
    "sections": {
        "NAME": {
            "content": "pnmsmooth - smooth out an image\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pnmsmooth [-width=cols] [-height=rows] [pnmfile] [-size]\n\nMinimum unique abbreviations of options is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npnmsmooth  smoothes  out  an  image  by  replacing each pixel with the average of its width X\nheight neighbors.  It is implemented as a program that invokes pnmconvol with an  appropriate\nconvolution matrix.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee  Common Options ), pnmsmooth recognizes the following command line options:\n\n\n",
            "subsections": [
                {
                    "name": "-width=_",
                    "content": ""
                },
                {
                    "name": "-height=_",
                    "content": "These options specify the dimensions of the convolution  matrix.   Default  dimensions\nare 3 wide and 3 high.\n\nBefore  Netpbm  10.49  (December  2009), the maximum size of the convolution matrix is\nlimited by the maxval of the image such that width * height * 2 must  not  exceed  the\nmaxval.  (use pamdepth to increase the maxval if necessary).\n\nThese options were new in Netpbm 10.32 (February 2006).  Before that, use -size.\n\n"
                },
                {
                    "name": "-size",
                    "content": "obsoleted by -width and -height in Netpbm 10.32 (February 2006).\n\nWhen you use this option, the first two program arguments are the  width  and  height,\nrespectively,  of  the  convolution  matrix  and  do  the same thing as the -width and\n-height option values.  The third (optional) program argument is the input file name.\n\nIn reality, in old pnmsmooth, the width and height are two values of the -size option,\nbut the modern Netpbm command syntax paradigm doesn't allow an  option  with  multiple\nvalues,  so  instead -size is an option with no value and width and height are program\narguments.  That has the fortunate effect of making the  following  command  mean  the\nsame in current pnmsmooth as in old pnmsmooth:\npnmsmooth -size 5 5 infile.ppm >outfile.ppm\n\n\n"
                },
                {
                    "name": "-dump=_",
                    "content": "This options makes pnmsmooth only show you the convolution matrix.  It writes to Stan‐\ndard  Output a pnmconvol -matrix option value that represents the matrix.  It does not\ninvoke pnmconvol and does not produce an output image.\n\nBefore Netpbm 10.49 (December 2009), this option is rather different.  It takes a file\nname as a value, and it writes to that file the convolution matrix as a PGM  file  (as\nused to be the normal input for pnmconvol).\n\n\n\n\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pnmconvol(1), pnm(1)\n\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "Before  Netpbm  10.32  (February  2006), pnmsmooth did not use the modern Netpbm command line\nparser, so had an unconventional command line syntax.  Most importantly, you could not use an\nequal sign or double hyphens in the options.\n\nBefore Netpbm 10.49 (December 2009), there was a -dump option.  This  strange  option  caused\npnmsmooth  not to do any smoothing or produce any output image but instead write the convolu‐\ntion matrix it would have used, as PGM file such as pnmconvol used to  use,  to  a  file  you\nspecify.  The idea was you could then use that file with a separate invocation of pnmconvol.\n\nThen,  in  Netpbm 10.49, there was a rather different -dump option with a similar purpose: It\ncaused pnmsmooth to write to Standard Error a string suitable as a value  for  the  pnmconvol",
            "subsections": [
                {
                    "name": "-matrix",
                    "content": "But  in Netpbm 10.51 (June 2010), pnmconvol started using the even newer pnmconvol -normalize\noption (new in 10.50), which made specifying the convolution matrix for the kind of smoothing\nthat pnmsmooth does trivial, so -dump disappeared from pnmsmooth.\n\n(There were also ease of implementation issues that kept us from simply keeping the  original"
                },
                {
                    "name": "-dump",
                    "content": "new features of pnmconvol, which pnmsmooth uses internally, the information needed to  imple‐\nment -dump was no longer available in the program).\n"
                }
            ]
        },
        "DOCUMENT SOURCE": {
            "content": "This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/pnmsmooth.html\n\nnetpbm documentation                      19 December 2009                  Pnmsmooth User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pnmsmooth - smooth out an image",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "These options specify the dimensions of the convolution matrix. Default dimensions are 3 wide and 3 high. Before Netpbm 10.49 (December 2009), the maximum size of the convolution matrix is limited by the maxval of the image such that width * height * 2 must not exceed the maxval. (use pamdepth to increase the maxval if necessary). These options were new in Netpbm 10.32 (February 2006). Before that, use -size."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "obsoleted by -width and -height in Netpbm 10.32 (February 2006). When you use this option, the first two program arguments are the width and height, respectively, of the convolution matrix and do the same thing as the -width and -height option values. The third (optional) program argument is the input file name. In reality, in old pnmsmooth, the width and height are two values of the -size option, but the modern Netpbm command syntax paradigm doesn't allow an option with multiple values, so instead -size is an option with no value and width and height are program arguments. That has the fortunate effect of making the following command mean the same in current pnmsmooth as in old pnmsmooth: pnmsmooth -size 5 5 infile.ppm >outfile.ppm"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This options makes pnmsmooth only show you the convolution matrix. It writes to Stan‐ dard Output a pnmconvol -matrix option value that represents the matrix. It does not invoke pnmconvol and does not produce an output image. Before Netpbm 10.49 (December 2009), this option is rather different. It takes a file name as a value, and it writes to that file the convolution matrix as a PGM file (as used to be the normal input for pnmconvol)."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pnmconvol",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmconvol/1/json"
        },
        {
            "name": "pnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Smooth out a PNM image.",
        "examples": [
            {
                "description": "Smooth out a PNM image using a convolution matrix of size 3x3",
                "command": "pnmsmooth {{path/to/input.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Smooth out a PNM image using a convolution matrix of size width times height",
                "command": "pnmsmooth {{-w|-width}} {{width}} {{-h|-height}} {{height}} {{path/to/input.pnm}} > {{path/to/output.pnm}}"
            }
        ]
    }
}