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
40 -verbose
41 This option causes xwdtopnm to display handy information about
42 the input image and the conversion process
43
44
45 -headerdump
46 This option causes xwdtopnm to display the contents of the X11
47 header. It has no effect when the input is X10. This option
48 was new in Netpbm 10.26 (December 2004).
49
50
51
52
54 Two Byte Samples
55 xwdtopnm sometimes produces output with a maxval greater than 255,
56 which means the maximum value of a sample (one intensity value, e.g.
57 the red component of a pixel) is greater than 255 and therefore each
58 sample takes 2 bytes to represent. This can be a problem because some
59 programs expect those bytes in a different order from what the Netpbm
60 format specs say, which is what xwdtopnm produces, which means they
61 will see totally different colors that they should. xv is one such
62 program.
63
64 If this is a problem (e.g. you want to look at the output of xwdtopnm
65 with xv), there are two ways to fix it:
66
67
68
69 · Pass the output through pamendian to produce the format the pro‐
70 gram expects.
71
72 · Pass the output through pamdepth to reduce the maxval below 256
73 so there is only one byte per sample.
74
75
76 Often, there is no good reason to have a maxval greater than 255. It
77 happens because in XWD, byte not PNM, each color component of a pixel
78 can have different resolution, for example 5 bits for blue (maxval 31),
79 5 bits for red (maxval 31), and 6 bits for green (maxval 63), for a
80 total of 16 bits per pixel. In order to reproduce the colors as
81 closely as possible, xwdtopnm has to use a large maxval. In this exam‐
82 ple, it would use 31 * 63 = 1953, and use 48 bits per pixel.
83
84 Because this is a common and frustrating problem when using xwdtopnm,
85 the program issues a warning whenever it generates output with two byte
86 samples. You can quiet this warning with the -quiet common option
87 ⟨index.html#commonoptions⟩ . The warning was new in Netpbm 10.46
88 (March 2009).
89
90
91
93 pnmtoxwd(1), pamendian(1), pamdepth(1), pnm(1), xwd man page
94
95
97 Copyright (C) 1989, 1991 by Jef Poskanzer.
98
99
100
101netpbm documentation 21 January 2009 Xwdtopnm User Manual(0)