# phpman > man > ppmdist(1)

> **TLDR:** Produce a grayscale version of a PPM image.
>
- Produce a grayscale version of the specified PPM image:
  `ppmdist {{path/to/input.ppm}} > {{path/to/output.pgm}}`
- Use the specified method to map colors to graylevels:
  `ppmdist -{{frequency|intensity}} {{path/to/input.ppm}} > {{path/to/output.pgm}}`

*Source: tldr-pages*

---

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



## NAME
       ppmdist - simplistic grayscale assignment for machine generated, color images

## SYNOPSIS
       **ppmdist** [**-intensity**|**-frequency**] [_ppmfile_]

## DESCRIPTION
       Reads a portable pixmap as input, performs a simplistic grayscale assignment intended for use
       with grayscale or bitmap printers.

       Often conversion from ppm to pgm will yield an image with contrast too low for  good  printer
       output.  The program maximizes contrast between the gray levels output.

       A ppm input of n colors is read, and a pgm of n gray levels is written.  The gray levels take
       on the values 0..n-1, while maxval takes on n-1.

       The mapping from color to stepped grayscale can be performed in order of input  pixel  inten‐
       sity, or input pixel frequency (number of repetitions).

## OPTIONS
### -frequency
                     mapping to evenly distributed graylevels of output.  **-intensity** Sort input col‐
                     ors  by  their  grayscale  intensity,  before  mapping  to  evenly  distributed
                     graylevels of output.  This is the default.

## BUGS
       Helpful only for images with a very small number of colors.  Perhaps should have been an  op‐
       tion to [ppmtopgm(1)](https://www.chedong.com/phpMan.php/man/ppmtopgm/1/markdown).

## SEE ALSO
       [ppmtopgm(1)](https://www.chedong.com/phpMan.php/man/ppmtopgm/1/markdown), [ppmhist(1)](https://www.chedong.com/phpMan.php/man/ppmhist/1/markdown), [ppm(5)](https://www.chedong.com/phpMan.php/man/ppm/5/markdown)

## AUTHOR
       Copyright (C) 1993 by Dan Stromberg.



                                            22 July 1992                                  [ppmdist(1)](https://www.chedong.com/phpMan.php/man/ppmdist/1/markdown)
