Using xv to capture and convert images


Why xv?

Some graphics packages have limited facilities for printing or saving the graphics which they produce; moreover, sometimes you want to use the contents of a Unix graphics window to illustrate a document. This sheet tells you how to use the program xv to help you achieve those aims.

What is xv?

xv is "an interactive image display for the X Windows system", to quote the man page (man xv). It can capture and save a window from the screen of a Unix workstation, and also convert graphics files from one format to another.

xv is available on all ISS Unix workstations.

Unix time sharing systems

xv is also available when using any ISS time sharing system (Finan, Aidan, etc.) from an X Window system, such as eXceed on the ISS PCs.

The easiest option for using eXceed on a ISS PC is Start / Communications / X Windows - eXceed / finan.ncl, which opens a single X window; but in this case you would probably use eXceed's built-in facility to capture a window, and not xv! However you do have the more complicated option of opening a full Solaris desktop session, in which case you would have the full facilities of xv.

Using the xv command

xv allows you to capture the contents of a Unix window: this may be the entire window or a rectangular selection. The image can then be saved into a file or printed.

First display the window or image you wish to capture.

Take care that the window to be saved is not partially obscured by other windows, otherwise the latter will be superimposed on the captured image: control windows created by the xv program can be temporarily hidden, but other windows should be moved out of the way, either by shrinking them or by iconising them using the "dot" button in the top right corner.

In a Unix command window, type the command:

xv

and a small xv banner window appears.

Next click the right-hand mouse button in the xv window, and an xv Controls window appears.

In the course of the following procedures other windows will appear, so it is advisable to move the xv Controls window to a position where it will be found easily, for example a corner of the desktop.

Capturing the window

From now on, all "clicking" means using the left mouse button.

In the xv Controls window click on Grab to see the xv Grab window

If the xv windows are obscuring the window you wish to capture, click on the Hide XV windows box, which causes xv windows to be hidden at the appropriate time.

Click the Grab button in the xv Grab window, move the cursor into the target window and click again. A new window containing a copy of the target window is now opened: this can be distinguished from the original by its xv title bar.

An alternative way to grab the window is to use the autograb feature. In the xv Grab window, set a delay long enough for you to move the cursor, e.g. 3 seconds. Click the Autograb button and then move the cursor to the target window. The window will then be grabbed automatically.

Selecting an area from the captured image

In the grabbed image window a rectangular area can be selected: define the area by holding down the left mouse button at one corner of the area you want and dragging it until the required rectangle is defined. If it is wrong, click once to remove it and try again.

Other facilities

Colours can be edited and many other changes made: for details see Further Information below.

Saving the captured image

When you are finally satisfied, return to the xv Controls window and click Save. (Note, if you did not park this window out of the way it may now be obscured or totally hidden by the copy of the window you have grabbed.)

When you have clicked on Save, the xv save window appears. Here you select the desired format and colour, for example GIF and Full Color.

In the Save file: box, type a suitable file name and press Return.

If such saved files are transferred to a PC via ftp, make sure that the transfer is done in binary mode.

Note: the size of an image file is determined by the choices you make on resolution and colours; this in turn has a fundamental influence on the storage, efficiency and printing of a document.

Printing a captured window

If you wish to send the captured window directly to a printer, click Print in the xv Controls window. At the prompt type the appropriate command (for example lpr -P local_colpsa4).

The xv postscript window asks you to set the orientation (portrait or landscape), paper size (A4 or A3) and some other items such as position. Select OK.

Finally return to the xv Controls window and select Quit.

Displaying and printing graphics files

Make sure that you are in the directory that contains the graphic file then start xv.

In the xv Controls window click on Load (not Grab as before). A list of files in the current directory will be displayed in the xv load window with a scroll bar so that you can see all the file names.

Select the graphic file that you wish to display, click on its name then on OK.

If you wish to print the picture make sure that nothing overlaps the graphic image before selecting Print.

Set up printing as described in the previous section.

Further information

xv is actually a very large and complex program! See a brief description by typing:

man xv

The full manual may be viewed or printed from the PDF file at:

http://www.ncl.ac.uk/ucs/docs/pdf/xv.pdf

(Note that the file size is 857kb, and the manual is 128 pages.)