| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 | <html><head><title>Xwdtopnm User Manual</title></head> |
| 3 | <body> |
| 4 | <h1>xwdtopnm</h1> |
| 5 | Updated: 08 January 2010 |
| 6 | <br> |
| 7 | <a href="#index">Table Of Contents</a> |
| 8 | |
| 9 | <h2>NAME</h2> |
| 10 | xwdtopnm - convert an X11 or X10 window dump file to a PNM image |
| 11 | |
| 12 | <h2 id="synopsis">SYNOPSIS</h2> |
| 13 | |
| 14 | <b>xwdtopnm</b> |
| 15 | [<b>-verbose</b>] |
| 16 | [<b>-headerdump</b>] |
| 17 | [<i>xwdfile</i>] |
| 18 | |
| 19 | <h2 id="description">DESCRIPTION</h2> |
| 20 | |
| 21 | <p>This program is part of <a href="index.html">Netpbm</a>. |
| 22 | |
| 23 | <p><b>xwdtopnm</b> reads an X11 or X10 window dump file as input and |
| 24 | produces a PNM image as output. The type of the output image depends |
| 25 | on the input file - if it's black and white, the output is PBM. If |
| 26 | it's grayscale, the output is PGM. Otherwise, it's PPM. The program |
| 27 | tells you which type it is writing. |
| 28 | |
| 29 | <p>Using this program, you can convert anything you can display on an |
| 30 | X workstation's screen into a PNM image. Just display whatever you're |
| 31 | interested in, run the <b>xwd</b> program to capture the contents of |
| 32 | the window, run it through <b>xwdtopnm</b>, and then use <b>pamcut</b> |
| 33 | to select the part you want. |
| 34 | |
| 35 | <p>Note that a pseudocolor XWD image (typically what you get when you |
| 36 | make a dump of a pseudocolor X window) has maxval 65535, which means |
| 37 | the PNM file that <b>xwdtopnm</b> generates has maxval 65535. Many |
| 38 | older image processing programs (that aren't part of the Netpbm |
| 39 | package and don't use the Netpbm programming library) don't know how |
| 40 | to handle a PNM image with maxval greater than 255 (because there are |
| 41 | two bytes instead of one for each sample in the image). So you may |
| 42 | want to run the output of <b>xwdtopnm</b> through <b>pamdepth</b> |
| 43 | before feeding it to one of these old programs. |
| 44 | |
| 45 | <p><b>xwdtopnm</b> can't convert every kind of XWD image (which essentially |
| 46 | means it can't convert an XWD created from every kind of X display |
| 47 | configuration). In particular, it cannot convert one with more than 24 bits |
| 48 | per pixel. |
| 49 | |
| 50 | |
| 51 | <h2 id="options">OPTIONS</h2> |
| 52 | |
| 53 | <p>In addition to the options common to all programs based on libnetpbm |
| 54 | (most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> |
| 55 | Common Options</a>), <b>xwdtopnm</b> recognizes the following |
| 56 | command line options: |
| 57 | |
| 58 | <dl> |
| 59 | <dt><b>-verbose</b> |
| 60 | <dd>This option causes <b>xwdtopnm</b> to display handy information about the |
| 61 | input image and the conversion process. |
| 62 | |
| 63 | <dt><b>-headerdump</b> |
| 64 | |
| 65 | <dd>This option causes <b>xwdtopnm</b> to display the contents of the |
| 66 | X11 header. It has no effect when the input is X10. This option was |
| 67 | new in Netpbm 10.26 (December 2004). |
| 68 | |
| 69 | </dl> |
| 70 | |
| 71 | <h2 id="notes">NOTES</h2> |
| 72 | |
| 73 | <h3 id="twobytesamples">Two Byte Samples</h3> |
| 74 | |
| 75 | <p><b>xwdtopnm</b> sometimes produces output with a maxval greater than 255, |
| 76 | which means the maximum value of a sample (one intensity value, e.g. the |
| 77 | red component of a pixel) is greater than 255 and therefore each sample |
| 78 | takes 2 bytes to represent. This can be a problem because some programs |
| 79 | expect those bytes in a different order from what the Netpbm format specs |
| 80 | say, which is what <b>xwdtopnm</b> produces, which means they will see totally |
| 81 | different colors than they should. <b>xv</b> is one such program. |
| 82 | |
| 83 | <p>If this is a problem (e.g. you want to look at the output of <b>xwdtopnm</b> |
| 84 | with <b>xv</b>), there are two ways to fix it: |
| 85 | |
| 86 | <ul> |
| 87 | <li>Pass the output through <b>pamendian</b> to produce the format the |
| 88 | program expects. |
| 89 | <li>Pass the output through <b>pamdepth</b> to reduce the maxval below 256 |
| 90 | so there is only one byte per sample. |
| 91 | </ul> |
| 92 | |
| 93 | <p>Often, there is no good reason to have a maxval greater than 255. It |
| 94 | happens because in XWD, but not PNM, each color component of a pixel can have |
| 95 | different resolution, for example 5 bits for blue (maxval 31), 5 bits for red |
| 96 | (maxval 31), and 6 bits for green (maxval 63), for a total of 16 bits per |
| 97 | pixel. In order to reproduce the colors as closely as possible, |
| 98 | <b>xwdtopnm</b> has to use a large maxval. In this example, it would use |
| 99 | maxval 31 * 63 = 1953, which requires two bytes per sample, totalling 48 bits |
| 100 | per pixel. |
| 101 | |
| 102 | <p>Because this is a common and frustrating problem when using <b>xwdtopnm</b>, |
| 103 | the program issues a warning whenever it generates output with two byte |
| 104 | samples. You can quiet this warning with the <b>-quiet</b> <a href="index.html#commonoptions">common option</a>. The warning was new in Netpbm 10.46 |
| 105 | (March 2009). |
| 106 | |
| 107 | |
| 108 | <h2 id="seealso">SEE ALSO</h2> |
| 109 | |
| 110 | <a href="pnmtoxwd.html">pnmtoxwd</a>, |
| 111 | <a href="pamendian.html">pamendian</a>, |
| 112 | <a href="pamdepth.html">pamdepth</a>, |
| 113 | <a href="pnm.html">pnm</a>, |
| 114 | <b>xwd</b> man page |
| 115 | |
| 116 | <h2 id="author">AUTHOR</h2> |
| 117 | |
| 118 | Copyright (C) 1989, 1991 by Jef Poskanzer. |
| 119 | |
| 120 | <hr> |
| 121 | |
| 122 | <h2 id="index">Table Of Contents</h2> |
| 123 | <ul> |
| 124 | <li><a href="#synopsis">SYNOPSIS</a> |
| 125 | <li><a href="#description">DESCRIPTION</a> |
| 126 | <li><a href="#options">OPTIONS</a> |
| 127 | <li><a href="#notes">NOTES</a> |
| 128 | <ul> |
| 129 | <li><a href="#twobytesamples">Two Byte Samples</a> |
| 130 | </ul> |
| 131 | <li><a href="#seealso">SEE ALSO</a> |
| 132 | <li><a href="#author">AUTHOR</a> |
| 133 | </ul> |
| 134 | </body> |
| 135 | </html> |