# man > pnmtoxwd(1)

> **TLDR:** Convert a PNM file into an X11 window dump file.
>
- Convert a PNM image file to XWD:
  `pnmtoxwd {{path/to/input_file.pnm}} > {{path/to/output_file.xwd}}`
- Produce the output in the DirectColor format:
  `pnmtoxwd {{-d|-directcolor}} {{path/to/input_file.pnm}} > {{path/to/output_file.xwd}}`
- Set the color depth of the output to b bits:
  `pnmtoxwd {{-ps|-pseudodepth}} {{b}} {{path/to/input_file.pnm}} > {{path/to/output_file.xwd}}`

*Source: tldr-pages*

---

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



## NAME
       pnmtoxwd - convert a portable anymap into an X11 window dump

## SYNOPSIS
       **pnmtoxwd** [**-pseudodepth** _n_] [**-directcolor**] [_pnmfile_]

## DESCRIPTION
       Reads  a  portable anymap as input.  Produces an X11 window dump as output.  This window dump
       can be displayed using the xwud tool.

       Normally, pnmtoxwd produces a StaticGray dump file for _pbm_ and _pgm_ files.  For _ppm_, it writes
       a  PseudoColor  dump  file if there are up to 256 colors in the input, and a DirectColor dump
       file otherwise.  The **-directcolor** flag can be used to force  a  DirectColor  dump.   And  the
### -pseudodepth
       bits / 256 colors.

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

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



                                          24 September 1991                              [pnmtoxwd(1)](https://www.chedong.com/phpMan.php/man/pnmtoxwd/1/markdown)
