cmd:xwd - dump an image of an X window 

Usage 

xwd | xwdtopnm | ppmquant 256 | ppmtojpeg > clip.jpg
xwd -frame | xwdtopnm | ppmquant 256 | ppmtogif -interlace > clip.gif
xwd | tee c1 | xwdtopnm | ppmtogif -interlace > clip.gif; bakfs -s gif clip.gif
display !$ &
xwd -frame | xwud

Info 

xwd - dump an image of an X window

Xwd is an X Window System window dumping utility. Xwd allows X users to store window images in a specially formatted dump file. This file can then be read by various other X utilities for redisplay, printing, editing, formatting, archiving, image processing, etc. The target window is selected by clicking the pointer in the desired window. The keyboard bell is rung once at the beginning of the dump and twice when the dump is completed.

-frame  This option indicates that the window manager frame should be
        included when manually selecting a window.

Source 

$ rpmqf /usr/X11R6/bin/xwd
XFree86-4.1.0-3
$ rpmqf /usr/bin/ppmtogif
netpbm-progs-9.14-2

Trying History 

Symptom 

X Error of failed request:  BadValue (integer parameter out of range for operation)
 Major opcode of failed request:  91 (X_QueryColors)
 Value in failed request:  0x4007dc
 Serial number of failed request:  2093
 Current serial number in output stream:  2093

Solution 

Do not start Netscape in "private color map" mode, ie, launch Netscape using 'ns' that has parameter '-install'.