What is xv?

xv is an interactive image manipulation program for the X Window System. It can operate on images in the GIF, JPEG, TIFF, PBM, PGM, PPM, XPM, X11 bitmap, Sun Rasterfile, Targa, RLE, RGB, BMP, PCX, FITS, and PM formats on all known types of X displays. It can generate PostScript files, and if you have ghostscript (version 2.6 or above) installed on your machine, it can also display them.

xv lets you do a large number of things (many of them actually useful), including, but not limited to, the following:

  • display an image in a window on the screen
  • display an image on the root window, in a variety of styles
  • grab any rectangular portion of the screen and turn it into an image
  • arbitrarily stretch, compress, rotate or flip the image
  • crop or pad images
  • view files as ASCII text or hexadecimal data
  • magnify any portion of the image by any amount, up to the size of the screen
  • determine pixel values and x,y coordinates in the image
  • adjust image brightness and contrast with a gamma correction function
  • apply different gamma functions to the Red, Green, and Blue color components, to correct for non-linear color response
  • adjust global image saturation
  • perform global hue remapping
  • perform histogram equalization
  • run a number of image-processing algorithms on any rectangular portion of the image
  • edit an image's colormap
  • reduce the number of colors in an image
  • dither in color and b/w
  • crop off solid borders automatically
  • convert image formats


xv runs on all the popular Unix platforms, and most of the unpopular ones as well, including:

  • Sun (SunOS & Solaris)
  • SGI (Irix)
  • DEC (Ultrix, OSF/1)
  • IBM (AIX)
  • HP (HPUX)
  • PCs (Linux, NetBSD, FreeBSD, etc.)
  • and many others

Since xv is distributed as source, it'll pretty much run on anything that has an ANSI C compiler (i.e., gcc), and runs X11R4 or greater. And if you're willing to live without TIFF support, you can build the whole thing with a stinky ol' K&R C compiler (/bin/cc on most machines).

xv also runs on VMS, thanks to the continued efforts of Rick Dyson. Me, I've never even seen a VMS machine!

xv also runs on Windows NT, sort of. Phil Schmidt has compiled binaries of xv for Windows NT running on Intel and MIPS processors. However, in either case, you must also have an X server (such as DEC's eXcursion product) running on the NT machine. This version of xv is not a standalone Win95/NT program!

What xv is Not!

xv is not a format-converter

While xv can convert images from one format to another, this is not what it was designed to do, and as a direct result, does it poorly. The most notable flaw is that it has no way to do 'bulk' conversion of a number of files - images need to be converted by hand, one at a time.

The damnedest thing (from my perspective) is how many people assume that xv does bulk conversion, and that somehow I must've forgotten to document this feature anywhere. It doesn't. It'd be akin to using Microsoft Word as a bulk text-file-to-PostScript converter. (Which may be a bad analogy: for all I know, the Truly Insane might be able to write a WinBasic program that does just that.)

Anyway - I absolutely guarantee that this feature will be added (by popular demand) in xv 4.00. In the interim, there is almost no format conversion problem that can't be quickly (and easily) solved with some combination of the netpbm package, ghostscript, and cjpeg/djpeg. All of these programs are freely available on the net, and I highly recommend them for all your format-convertin' needs.

xv is not a paint program

While The GIMP has gone a long way toward proving me wrong, I've long held that X11 is, by its very nature, not well-suited towards supporting a decent paint program. This belief has made itself apparent in my design of xv. While it is possible to do some remedial paint functions using xv, there are big glaring faults that become obvious when you try to do some painting. Most notably, you can only paint with colors that are already in a given picture. And let's not even talk about the Text Annotation command...

Basically, xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware.

xv is not a Windows program

xv runs on machines running Unix or VMS. While you can run xv on a PC (I do it all the time), you need to be running one of the Unix-for-PC products (I recommend RedHat Linux). You'd be surprised how many folks think 'binary' and 'runs on Windows' are synonymous...

For what it's worth, in the last few months I've done a little dabbling with Windows programming (Visual C++), and was impressed. I fully intend to (eventually) port XV to the Win95/98/NT/whatever platform.  I don't have any plan as to when precisely that might happen, other than sometime after a new Unix-based XV is released. And I don't know when that'll be, either.

Last Modified: May 07, 2006