xwpick(1)

NAME
xwpick - pick images from an X11-screen and store in files

SYNOPSIS
xwpick [-local] [-window id] [-gray] [-reverse] [<file>]

DESCRIPTION
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 format is defined by the extension in the file name. Possible extentions are:

.ps 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 transparency preparation.

.eps
    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.

.epsi
    The same as .eps, but contains a black and white preview.

.gif
    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
    PCX format for IBM PC.

.pict
    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
    PPM format from the PBM+ library by Jef Poskanzer. Use it and a routine from the PBM+ library if you wish to have the image in a format not mentioned above.

The main differences of xwpick from other such tools are:

•   the manner in which the user selects the rectangular area to be picked: the onmipresent blinking rectangle surrounding the area to be picked and involment of the keyboard input in addition to the mouse help to get rid of numerous parameters, nevertheless satisfying in quite a natural way the most common needs of users, namely, picking an image from a selected window or from an arbitrary rectangular area and a possibility to change the selected image just before outputing to a file.

•   the compression scheme used for image encoding in Postscript files: xwpick uses the Lepmpel-Ziv Welch (LZW) compression algorithms, thus producing very compact files (4-5 times less than files produced with Run-Length encoding and 10-20 times less than files produced without compression)

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.

After the rectangle has been selected the user should press the <SPACE> bar to pick the image. Before pressing the <SPACE> bar the user may to use the mouse to produce, if required, some changes inside the selected area, for example, to change the palette or display a pop-up menu.

OPTIONS

-local
    When -local is in the parameter list, xwpick picks an image from the window under the mouse pointer. This option is intented 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.

-window id
    Pick an image from the window with integer identifier equal to id. To pick the entire screen (root window) the user may to use the word root as an identifier.

-gray
    Transfer the image to grayscale.

-reverse
    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.

EXAMPLES

•   xwpick

This is the simplest form of use. You will be prompted to input a file name.

•   xwpick image.ppm
    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+ library.

•   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 preview.

•   xwininfo
    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.

AUTHOR
Evgeni Chernyaev chernaev@mx.ihep.su

SEE ALSO
xwd(1), xv(1), xgrabsc(1), XtoPS(1), xwininfo(1), ppm(5)

COPYRIGHT
Copyright (C) 1993, 1994 by Evgeni Chernyaev.