Xwpick lets you pick an image from an arbitrary window or rectangular
area of an X11-server and write it to a file in a variety of formats.
The output format is defined whether by the -format option or
by the extension in the file name. Possible formats/extentions are:
An Encapsulated PostScript file with a compressed image. The image is
centered, rotated and scaled to fill the maximum space on a page. It
is displayed in color on viewers and printers that support color Postscript,
otherwise it is displayed as grayscale. This format is convenient for
Also an Encapsulated PostScript file with a compressed image, but the image
is only centered, not rotated and scaled. It is intended for insertion
into a document.
The same as eps, but contains a black and white preview.
Graphics Interchange Format (GIF). Use this format when you want to keep files
or transfer them to other computers. It is also convenient for visualisations,
for example, with xv by John Bradley.
PCX format for IBM PC.
PICT format for Macintosh. It is intended for image transfer on Macintosh,
but GIF format is also convenient for this purpose
(see Macintosh GIFConverter by Kevin A. Mitchell).
PPM format from the PBM Plus library by Jef Poskanzer. Use it and a routine
from the PBM Plus library if you wish to have the image in a format not
The main feature of xwpick is that it uses the Lempel-Ziv
Welch (LZW) compression scheme for image encoding in Postscript, thus
producing very compact files (4-5 times less than files produced
with Run-Length encoding (RLE) and 10-20 times less than files produced
HOW IT WORKS
When xwpick is invoked, the user sees a blinking rectangle
surrounding the contents of the window in which the mouse pointer is
currently placed. When the mouse is moved to a different window,
the perimeter automatically changes to the size of the new window.
If the mouse pointer is placed on the Window Manager border of a window,
then the blinking rectangle will surround the window together with
the Window Manager border. To select the image inside the blinking
rectangle it is sufficient to click the left mouse button.
If a user-defined perimeter is required, then hold down the left mouse
button to choose the first corner of the perimeter and then drag the
mouse to define the opposite corner. The blinking rectangle will expand
with the movement of the mouse.
If it is required to produce some changes inside the selected area just
before outputing to a file, for example, to change the palette or display
a pop-up menu, then the -pause option can be used.
When -local is in the parameter list, xwpick picks an image from
the window under the mouse pointer. This option is intended to pick images
from pop-up menus, which are on the screen only when a mouse button is
pressed and disappear immediately after the button is released.
Pick an image from the window with integer identifier equal to id.
The identifier for a window can be obtained with the X Window program
xwininfo. To pick the entire screen (root window) the user may use
the word root as an identifier.
Transfer the image to grayscale. This option can be used to optimize
output on level 1 gray scale PostScript printers.
Transfer the image to reverse colors. This option can help you
to save the toner on your printer in case when the image is too dark.
Do not output the image till the <SPACE> bar will be pressed. This
option allows to use the mouse to produce some changes inside the
selected image just before outputing to a file.
Set output format. The format is defined by frmt string. If this
option is omited, then the output format is defined by the extension in
the file name. Possible frmt strings/extensions are:
ps, eps, epsi, gif, pcx, pict, ppm.
In case when -format is in the parameter list and a file name is
omited the output is directed to the standard output.
This is the simplest form of use. You will be prompted to input
a file name.
ppmtoxpm image >image.xpm
This is an example of how to get an image in X11 pixmap format.
First you pick the image from the screen into the file image.ppm
and then convert it using the ppmtoxpm routine from the PBM PLUS
xwpick -local menu.epsi
This is an example of how to pick the image of a pop-up menu
window and store it in a file as encapsulated Postscript with
xwpick -w 0x8000c1 -g clock.ps
This is an example of how to pick an image from the window
by the window's identifier. First you find the identifier using
the xwininfo command and then pick an image from the window
and store it in a Postscript file as a grayscale image.
xwpick -window root -format ps | lpr
This is an example of how to send an image of the root window directly
to the printer.