# pnmsmooth - man(1) - [phpMan]

> **TLDR:** Smooth out a PNM image.
>
- Smooth out a PNM image using a convolution matrix of size 3x3:
  `pnmsmooth {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Smooth out a PNM image using a convolution matrix of size width times height:
  `pnmsmooth {{-w|-width}} {{width}} {{-h|-height}} {{height}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`

*Source: tldr-pages*

---

_Pnmsmooth_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)               General Commands Manual              _Pnmsmooth_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

## NAME
       pnmsmooth - smooth out an image


## SYNOPSIS
       **pnmsmooth **[**-width=_**cols_] [**-height=_**rows_] [_pnmfile_] [**-size**]

       Minimum unique abbreviations of options is acceptable.  You may use double hyphens instead of
       single hyphen to denote options.  You may use white space in place of the equals sign to sep‐
       arate an option name from its value.


## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **pnmsmooth  **smoothes  out  an  image  by  replacing each pixel with the average of its width X
       height neighbors.  It is implemented as a program that invokes **pnmconvol **with an  appropriate
       convolution matrix.


## OPTIONS
       In  addition  to  the options common to all programs based on libnetpbm (most notably **-quiet**,
       see [ Common Options](index.html#commonoptions) ), **pnmsmooth **recognizes the following command line options:



### -width=_

### -height=_
              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**.


### -size  
              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



### -dump=_
              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**).






## SEE ALSO
       [**pnmconvol**(1)](https://www.chedong.com/phpMan.php/man/pnmconvol/1/markdown), [**pnm**(1)](https://www.chedong.com/phpMan.php/man/pnm/1/markdown)


## HISTORY
       Before  Netpbm  10.32  (February  2006), **pnmsmooth **did not use the modern Netpbm command line
       parser, so had an unconventional command line syntax.  Most importantly, you could not use an
       equal sign or double hyphens in the options.

       Before Netpbm 10.49 (December 2009), there was a **-dump **option.  This  strange  option  caused
       **pnmsmooth  **not to do any smoothing or produce any output image but instead write the convolu‐
       tion matrix it would have used, as PGM file such as **pnmconvol **used to  use,  to  a  file  you
       specify.  The idea was you could then use that file with a separate invocation of **pnmconvol**.

       Then,  in  Netpbm 10.49, there was a rather different **-dump **option with a similar purpose: It
       caused **pnmsmooth **to write to Standard Error a string suitable as a value  for  the  **pnmconvol**
### -matrix 

       But  in Netpbm 10.51 (June 2010), **pnmconvol **started using the even newer **pnmconvol -normalize**
       option (new in 10.50), which made specifying the convolution matrix for the kind of smoothing
       that **pnmsmooth **does trivial, so **-dump **disappeared from **pnmsmooth**.

       (There were also ease of implementation issues that kept us from simply keeping the  original
### -dump  
       new features of **pnmconvol**, which **pnmsmooth **uses internally, the information needed to  imple‐
       ment **-dump **was no longer available in the 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/pnmsmooth.html>**

netpbm documentation                      19 December 2009                  _Pnmsmooth_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
