Linux Commands Examples

A great documentation place for Linux commands


convert a X11 or X10 window dump file into a portable anymap

see also : pnmtoxwd - xwd


xwdtopnm [xwdfile]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


xwd | xwdtopnm | pnmtopng > "/tmp/screenshot-`date +%Y%m%d-%H:%M:%S.png`"


Reads a X11 or X10 window dump file 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. The program tells you which type it is writing.

Using this program, you can convert anything on an X workstation’s screen into an anymap. Just display whatever you’re interested in, do an xwd, run it through xwdtopnm, and then use pnmcut to select the part you want.


I haven’t tested this tool with very many configurations, so there are probably bugs. Please let me know if you find any.

see also

pnmtoxwd , pnm, xwd


Copyright (C) 1989, 1991 by Jef Poskanzer.

How can this site be more helpful to YOU ?

give  feedback