![]()
What is xv ?
Introduction
xv is an interactive image display for the X Window SystemIt is an X11 program that displays images in the following formats:
GIF, PM, PBM, X11 bitmap, Sun Rasterfile, JPEG, TIFF, PGM, PPM, Utah Raster Toolkit RLE, PDS/VICARThese can be diplayed on 1-, 2-, 4-, 6-, 8-, 16-, 24-, and 32-bit X displays. xv will also read compress-ed versions of these files.
Using xv
Start the program up by typing 'xv'. After a short delay, a window will appear with the default image (the xv logo), displayed in it.![]()
If you change the size of the window (using whatever method your window manager provides), the image will be automatically stretched to fit the window.
The Control Panel
You can bring up the xv controls window by clicking the Right mouse button inside the image window.![]()
Cropping the Image
Clicking and dragging the Left button of the mouse inside the image window will allow you to draw a cropping rectangle on the image. If you're unhappy with the one you've drawn, simply click the Left button and draw another. If you'd like the rectangle to go away altogether, click the Left button and release it without moving the mouse.Click the Crop button in the xv controls window. The image window will shrink to show only portions of the image that were inside the cropping rectangle.
You can return to the original, uncropped image by using the UnCrop command. Simply click the UnCrop button or press the u key in any open xv window.
Displaying Pixel Values
Clicking (and optionally dragging) the Middle mouse button inside this window will display pixel information in the following format:196, 137 = 191,121,209 (287 42 81 HSV)The first pair of numbers (196,137) are the x and y positions of the cursor, in image coordinates. These numbers remain the same regardless of any image resizing, or cropping. For example, if you click on the eye of the fish on the right side of the default image, you'll get (approximately) 251,129 regardless of the size of the displayed image. The first triplet of numbers (191,121,209) are the RGB values of the selected pixel. The second triplet of numbers (287 42 81) are the HSV values
Grabbing a Screenshot image
The Grab command works as follows:Click on the Grab button in the xv controls window. A window will appear with more instructions/options. To take a simple grab, click on the grab button. The terminal will beep once to inform you it is in grab mode and the screen will remain frozen until you complete the Grab command.
You can Grab an arbitrary region of the screen by clicking the Middle mouse button and dragging a rectangle in exactly the same way you draw a cropping rectangle. When you let go of the mouse button, the contents of this rectangle will be read from the screen and loaded into xv.
Alternately, you can grab the entire contents of a window (including its frame) by clicking the Left mouse button anywhere inside the chosen window. If you click the Left mouse button somewhere on the root window, the entire screen will be loaded into xv.
Or, alternately, you can simply abort the Grab command by clicking the Right mouse button anywhere on the screen.
Saving the image
Click on the Save button in the xv controls window. You can write images back many different formats, not just the original format.Warning! Images are saved as they are currently shown (at the current size, with the current color modification, rotation, cropping, etc. applied).At the bottom of the window are a list of possible formats in which you can save the file. If you click on one of these formats, and your filename has a recognized suffix (i.e., '.gif', '.GIF', '.pbm', etc.), the suffix portion of your filename will be replaced with the new, appropriate suffix for the selected format.
Some Format notes:
- GIF
- While xv can read both the GIF87a and GIF89a formats, it will only write GIF87a
- X11 Bitmap
- Saves files in the format used by the bitmap program, which is part of the standard X11 distribution. Since bitmap files are inherently 1-bit per pixel, you can only select the B/W Dithered option for this format.
- Sun Rasterfile
- Color images are stored in a 24-bit RGB format, Greyscale images are stored in an 8-bit greyscale format, and B/W Dithered images are stored in a 1-bit B/W format.
- PostScript
- Color images are stored in a 24-bit RGB format, Greyscale images are stored in an 8-bit greyscale format, and B/W Dithered images are stored in a 1-bit B/W format.
XV writes Encapsulated PostScript, so you can incorporate xv-generated PostScript into many desktop-publishing programs. XV also prepends some color-to-greyscale code, so even if your printer doesn't support color, you can still print 'color' PostScript images. These images will be three times larger (in file size) than their greyscale counterparts, so it's a good idea to save Greyscale PostScript, unless you know you may be printing the file on a color printer at some point.
- JPEG
- XV writes files in the JFIF format created by the Independent JPEG Group. Full/Reduced Color images are written in a 24-bit RGB format, and Greyscale images are written in an 8-bit greyscale format. B/W Dithered images should not be used, as they will end up being larger than Greyscale versions of the same images, due to the way JPEG works. Note: You cannot write Reduced Color JPEG files. If you attempt to, a Full Color JPEG file will be saved.
When you save in the JPEG format, a dialog box will pop up and ask you for a quality setting. '75%' is the default value, and really, it's a fine value. You shouldn't have to change it unless you're specifically trying to trade off quality for compression, or vice versa. The useful range of values is 5%-95%.
- TIFF
- Full/Reduced Color images are written in a 24-bit RGB format, Greyscale images are written in an 8-bit greyscale format, and B/W Dithered images are written in a 1-bit B/W format.
When you save in the TIFF format, a dialog box will pop up and ask you which type of image compression it should use. None, LZW, and PackBits compression types are available for Full/Reduced Color, Greyscale, and B/W Dithered modes. In addition, there are two B/W Dithered-only algorithms, CCITT Group3 and CCITT Group4.
M.Stonebank@ee.surrey.ac.uk 5th November 1998