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