1Xwdtopnm User Manual(0) Xwdtopnm User Manual(0)
2
3
4
6 xwdtopnm - convert an X11 or X10 window dump file to a PNM image
7
8
10 xwdtopnm [-verbose] [-headerdump] [xwdfile]
11
12
14 This program is part of Netpbm(1).
15
16 xwdtopnm reads an X11 or X10 window dump file as input and produces a
17 PNM image as output. The type of the output image depends on the input
18 file - if it's black and white, the output is PBM. If it's grayscale,
19 the output is PGM. Otherwise, it's PPM. The program tells you which
20 type it is writing.
21
22 Using this program, you can convert anything you can display on an X
23 workstation's screen into a PNM image. Just display whatever you're
24 interested in, run the xwd program to capture the contents of the win‐
25 dow, run it through xwdtopnm, and then use pamcut to select the part
26 you want.
27
28 Note that a pseudocolor XWD image (typically what you get when you make
29 a dump of a pseudocolor X window) has maxval 65535, which means the PNM
30 file that xwdtopnm generates has maxval 65535. Many older image pro‐
31 cessing programs (that aren't part of the Netpbm package and don't use
32 the Netpbm programming library) don't know how to handle a PNM image
33 with maxval greater than 255 (because there are two bytes instead of
34 one for each sample in the image). So you may want to run the output
35 of xwdtopnm through pamdepth before feeding it to one of these old pro‐
36 grams.
37
38 xwdtopnm can't convert every kind of XWD image (which essentially means
39 it can't convert an XWD created from every kind of X display configura‐
40 tion). In particular, it cannot convert one with more than 24 bits per
41 pixel.
42
43
44
46 -verbose
47 This option causes xwdtopnm to display handy information about
48 the input image and the conversion process
49
50
51 -headerdump
52 This option causes xwdtopnm to display the contents of the X11
53 header. It has no effect when the input is X10. This option
54 was new in Netpbm 10.26 (December 2004).
55
56
57
58
60 Two Byte Samples
61 xwdtopnm sometimes produces output with a maxval greater than 255,
62 which means the maximum value of a sample (one intensity value, e.g.
63 the red component of a pixel) is greater than 255 and therefore each
64 sample takes 2 bytes to represent. This can be a problem because some
65 programs expect those bytes in a different order from what the Netpbm
66 format specs say, which is what xwdtopnm produces, which means they
67 will see totally different colors that they should. xv is one such
68 program.
69
70 If this is a problem (e.g. you want to look at the output of xwdtopnm
71 with xv), there are two ways to fix it:
72
73
74
75 · Pass the output through pamendian to produce the format the pro‐
76 gram expects.
77
78 · Pass the output through pamdepth to reduce the maxval below 256
79 so there is only one byte per sample.
80
81
82 Often, there is no good reason to have a maxval greater than 255. It
83 happens because in XWD, byte not PNM, each color component of a pixel
84 can have different resolution, for example 5 bits for blue (maxval 31),
85 5 bits for red (maxval 31), and 6 bits for green (maxval 63), for a
86 total of 16 bits per pixel. In order to reproduce the colors as
87 closely as possible, xwdtopnm has to use a large maxval. In this exam‐
88 ple, it would use 31 * 63 = 1953, and use 48 bits per pixel.
89
90 Because this is a common and frustrating problem when using xwdtopnm,
91 the program issues a warning whenever it generates output with two byte
92 samples. You can quiet this warning with the -quiet common option
93 ⟨index.html#commonoptions⟩ . The warning was new in Netpbm 10.46
94 (March 2009).
95
96
97
99 pnmtoxwd(1), pamendian(1), pamdepth(1), pnm(1), xwd man page
100
101
103 Copyright (C) 1989, 1991 by Jef Poskanzer.
104
106 This manual page was generated by the Netpbm tool 'makeman' from HTML
107 source. The master documentation is at
108
109 http://netpbm.sourceforge.net/doc/xwdtopnm.html
110
111netpbm documentation 8 January 2010 Xwdtopnm User Manual(0)