# xpmtoppm - convert an X11 pixmap to a PPM image - man(1) - [phpMan]

> **TLDR:** Convert an X11 pixmap to a PPM image.
>
- Convert an XPM image to a PPM image:
  `xpmtoppm {{path/to/input_file.xpm}} > {{path/to/output_file.ppm}}`
- Store the transparency mask of the input image in the specified file:
  `xpmtoppm {{-a|--alphaout}} {{path/to/alpha_file.pbm}} {{path/to/input_file.xpm}} > {{path/to/output_file.ppm}}`

*Source: tldr-pages*

---

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

## NAME
       xpmtoppm - convert an X11 pixmap to a PPM image


## SYNOPSIS
### xpmtoppm

       [**--alphaout=**{_alpha-filename_,**-**}] [**-verbose**]

       [_xpmfile_]


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

       **xpbtoppm  **reads  an X11 pixmap (XPM version 1 or 3) as input and produces a PPM image as out‐
       put.


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



       **--alphaout=_**alpha-filename_
              **xpmtoppm  **creates  a  PBM file containing the transparency mask for the image.  If the
              input image doesn't contain transparency information, the _alpha-filename_ file contains
              all white (opaque) transparency values.  If you  don't  specify  **--alphaout**,  **xpmtoppm**
              does  not generate a transparency file, and if the input image has transparency infor‐
              mation, **xpmtoppm **simply discards it.

              If you specify **- **as the filename, **xpmtoppm **writes the transparency output to  Standard
              Output and discards the image.

              See [**pamcomp**(1)](https://www.chedong.com/phpMan.php/man/pamcomp/1/markdown) for one way to use the transparency output file.

              **xpmtoppm  **can't handle a line longer than 8K characters in the XPM input.  If an input
              line exceeds this limit, **xpmtoppm **quits with an error message to that effect.   Before
              Netpbm 10.30 (October 2005), the limit was 2K.


### --verbose
              **xpmtoppm **prints information about its processing on Standard Error.




## LIMITATIONS
       **xpmtoppm  **recognizes  only a limited set of the features of XPM Version 3; i.e. it rejects as
       invalid many valid XPM images.

       The only place a comment block is valid is starting in Column 1 of the line immediately after
       "static char ...".

       In addition, **ppmtoxpm **properly recognizes any single-line comment that begins in Column 1  in
       the color table part of the file.

       There must be for every pixel a default colorname for a color type visual.

       Before Netpbm 10.58 (March 2012), zero bytes per pixel causes the program to fail with a mes‐
       sage about premature EOF on input.


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


## AUTHOR
       Copyright (C) 1991 by Jef Poskanzer.

       Upgraded to work with XPM version 3 by Arnaud Le Hors<<_lehors@mirsa.inria.fr_>>, Tue Apr 9 1991.

## 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/xpmtoppm.html>**

netpbm documentation                      31 December 2011                   _Xpmtoppm_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
