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