# phpman > man > pngtopnm(1)

> **TLDR:** This command has been superseded by `pngtopam`.
>
- View documentation for the current command:
  `tldr pngtopam`

*Source: tldr-pages*

---

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



## NAME
       pngtopnm - convert a Portable Network Graphics file into portable anymap

## SYNOPSIS
       **pngtopnm** [-verbose] [-alpha | -mix] [-background color]
       [-gamma value] [-text file] [-time] [_pngfile_]

## DESCRIPTION
       Reads  a Portable Network Graphics as input.  Produces a portable anymap as output.  The type
       of the output file depends on the input file - if it's black & white, a _pbm_ file is  written,
       else if it's grayscale a _pgm_ file, else a _ppm_ file.

## OPTIONS
### -verbose
              Display  the  format  of the input file and the type of the output file. If the chunks
              are part of the _png-file,_ the alpha, transparency and gamma-values will be indicated.

### -alpha
              file or _pgm_ file, depending on whether different levels of transparency appear.

### -mix
              background chunk is available that color is taken, else black will do.

### -background color
              If no background color chunck is present in the _png-file,_ or when another color is re‐
              quired this parameter can be used to set the background color of images. This is espe‐
              cially useful for alpha-channel images or those with transparency chunks. The  format,
              to  specify  the  color in, is either (in the case of orange) "1.0,0.5,0.0", where the
              values are floats between zero and one,  or  with  the  syntax  "#RGB",  "#RRGGBB"  or
              "#RRRRGGGGBBBB" where R, G and B are hexa-decimal numbers.

### -gamma value
              Converts  the  image to a new display-gamma value. When a gAMA chunk is present in the
              _png-file,_ the image-gamma value will be used. When not, the image-gamma is  considered
              to  be  1.0. Based on the image-gamma and the display-gamma given with this option the
              colors written to the _pnm-file_ will be adjusted.
              Because the gamma's of uncompensated monitors are around 2.6, which results in an  im‐
              age-gamma  of  0.45,  some  typical  situations are: when the image-gamma is 0.45 (use
              -verbose to check) and the picture is too light, your system  is  gamma-corrected,  so
              convert  with  "-gamma 1.0".  When no gAMA chunk is present or the image-gamma is 1.0,
              use 2.2 to make the picture lighter and 0.45 to make the picture darker.

### -text file
              Writes the tEXt and zTXt chunks to a file, in a format as described  in  the  _pnmtopng_
              man-page.  These chunks contain text comments or annotations.

### -time

       All flags can be abbreviated to their shortest unique prefix.

## SEE ALSO
       [pnmtopng(1)](https://www.chedong.com/phpMan.php/man/pnmtopng/1/markdown), [ptot(1)](https://www.chedong.com/phpMan.php/man/ptot/1/markdown), [pnmgamma(1)](https://www.chedong.com/phpMan.php/man/pnmgamma/1/markdown), [pnm(5)](https://www.chedong.com/phpMan.php/man/pnm/5/markdown)

## NOTE
       Instead  of  pngtopnm|pnmtoxxx, a specific converter should be used, if available. E.g.  _ptot_
       (PNG to TIFF conversion), etc.

## BUGS
       There could be an option to read the comment text from pnm comments  instead  of  a  separate
       file.

       The program could be much faster, with a bit of code optimizing.

## AUTHORS
       Copyright (C) 1995-1997 by Alexander Lehmann
                               and Willem van Schaik.



                                           6 January 1997                                [pngtopnm(1)](https://www.chedong.com/phpMan.php/man/pngtopnm/1/markdown)
