Modifying xv Behavior

xv supports literally dozens of command line options and X11 resources. Fortunately, it is doubtful that you'll ever need to use more than a small few. The rest are provided mainly for that 'one special case' application of xv... Note that you do not have to specify the entire option name, only enough characters to uniquely identify the option. Thus, ' -geom ' is a fine abbreviation of ' -geometry '.

Command Line Options Overview

If you start xv with the command ' xv -help ', the current (wildly out of control) list of options will be displayed:

xv [-] [-/+24] [-/+2xlimit] [-/+4x3] [-/+8] [-/+acrop] [-aspect w:h] [-best24] [-bg color] [-black color] [-bw width] [-/+cecmap] [-cegeometry geom] [-/+cemap] [-cgamma rval gval bval] [-cgeometry geom] [-/+clear] [-/+close] [-/+cmap] [-cmtgeometry geom] [-/+cmtmap] [-crop x y w h] [-cursor char#] [-DEBUG level] [-dir directory] [-display disp] [-/+dither] [-drift dx dy] [-expand exp | hexp:vexp] [-fg color] [-/+fixed] [-flist fname] [-gamma val] [-geometry geom] [-grabdelay seconds] [-gsdev str] [-gsgeom geom] [-gsres int] [-help] [-/+hflip] [-hi color] [-/+hist] [-/+hsv] [-icgeometry geom] [-/+iconic] [-igeometry geom] [-/+imap] [-/+lbrowse] [-lo color] [-/+loadclear] [-/+max] [-/+maxpect] [-mfn font] [-/+mono] [-name str] [-ncols #] [-/+ninstall] [-/+nodecor] [-/+nofreecols] [-/+nolimits] [-/+nopos] [-/+noqcheck] [-/+noresetroot] [-/+norm] [-/+nostat] [-/+owncmap] [-/+perfect] [-/+poll] [-preset #] [-quick24] [-/+quit] [-/+random] [-/+raw] [-rbg color] [-rfg color] [-/+rgb] [-RM] [-rmode #] [-/+root] [-rotate deg] [-/+rv] [-/+rw] [-slow24] [-/+smooth] [-/+stdcmap] [-tgeometry geom] [-/+vflip] [-/+viewonly] [-visual type] [-/+vsdisable] [-vsgeometry geom] [-/+vsmap] [-/+vsperfect] [-wait seconds] [-white color] [-/+wloop] [filename ...]

Yes, as a matter of fact, I am a little embarrassed about it.

One big change starting in xv 3.10: In the past, most of the command-line options were toggles, in that they would normally turn some feature on, but if you had an X resource that also turned that feature on, then they would turn that feature off. Now, they are absolute settings. For instance, ' -rv ' turns on reverse video mode, regardless of the setting of the ' xv.reverse ' resource, and ' +rv ' turns off reverse video mode, regardless of the setting of the ' xv.reverse ' resource. (Thanks Peder!)

General Options

Note: In the following sections, the part of the option name shown in boldface is the shortest allowable abbreviation of the option in question.

-help
Print usage instructions, listing the current available command-line options. Any unrecognized option will do this as well.

-display disp
Specifies the display that xv should attempt to connect to. If you don't specify a display, xv will use the environment variable $DISPLAY .

-fg color
Sets the foreground color used by the windows.

(Resource name: foreground . Type: string)

-bg color
Sets the background color used by the windows.

(Resource name: background . Type: string)

-hi color
Sets the highlight color used for the top-left edges of the control buttons.

(Resource name: highlight . Type: string)

-lo color
Sets the lowlight color used for the bottom-right edges of the control buttons, and also the background of some windows.

(Resource name: lowlight . Type: string)

-bw bwidth
Sets the width of the border on the windows. Your window manager may choose to ignore this, however.

(Resource name: borderWidth . Type: integer)

Image Sizing Options

-geometry geom
Lets you specify the size and placement of the 'image' window. It's most useful when you only specify a position, and let xv choose the size. If you specify a size as well, xv will create a window of that size, unless -fixed is specified. The geom argument is in the form of a normal X geometry string (e.g. "300x240" or "+10+10" or "400x300+10+10")

(Resource name: geometry . Type: string)

-/+fixed
Only used in conjunction with the -geometry option. If you specify a window size with the -geometry option, xv will normally stretch the picture to exactly that size. This is not always desirable, as it may seriously distort the aspect ratio of the picture. Specifying the -fixed option corrects this behavior by instructing xv to use the specified geometry size as a maximum window size. It will preserve the original aspect ratio of the picture. ( +fixed turns off this feature, forcing the image to be exactly the size specified by the -geometry option.)

For example, if you give a rectangular geometry of '320x240', and you try to display a square picture with a size of '256x256', the window opened will actually be '240x240', which is the largest square that still fits in the '320x240' rectangle that was specified.

(Resource name: fixed . Type: boolean)

-expand exp
Lets you specify an initial expansion or compression factor for the picture. You can specify floating-point values. Values larger than zero multiply the picture's dimensions by the given factor. (i.e., an expand factor of '3' will make a 320x200 image display as 960x600).

Factors less than zero are treated as reciprocals. (i.e., an expand factor of '-4' makes the picture 1/4 th its normal size.). '0' is not a valid expansion factor.

You can also specify a pair of expansion values, separated by a colon, to set different horizontal and vertical expansion ratios. For instance, '3:2' would expand images 3x horizontally, and 2x vertically.

(Resource name: expand . Type: string)

-aspect w:h
Lets you set an initial aspect ratio, and also sets the value used by the Aspect command. The aspect ratio of nearly every X display (and, in fact, any civilized graphics display) is 1:1. What this means is that pixels appear to be 'square'. A 100 pixel wide by 100 pixel high box will appear on the screen as a square. Unfortunately, this is not the case with some screens and digitizers. The -aspect option lets you stretch the picture so that the picture appears correctly on your display. Unlike the other size- related options, this one doesn't care what the size of the overall picture is. It operates on a pixel-by-pixel basis, stretching each image pixel slightly, in either width or height, depending on the ratio.

Aspect ratios greater than '1:1' (e.g., '4:3') make the picture wider than normal. Aspect ratios less than '1:1' (e.g. '2:3') make the picture taller than normal. (Useful aspect ratio: A 512x480 image that was supposed to fill a standard 4x3 video screen (produced by many video digitizers) should be displayed with an aspect ratio of '5:4')

(Resource name: aspect . Type: string)

Color Allocation Options

-ncols nc
Sets the maximum number of colors that xv will use. By default, this is 'as many as it can get'. However, you can set this to smaller values for interesting effect. If you set it to '0', it will display the picture by dithering with 'black' and 'white'. (The actual colors used can be set by the - black and -white options, below.)

The other major use of this option is to limit the number of colors used when putting up an image that's going to be hanging around for a while. (i.e., an image in the root window) You may want to limit the number of colors used for such images so that other programs will still have some colorcells available for their own use.

(Resource name: ncols . Type: integer)

-/+rw
Tells xv to use read/write color cells. Normally, xv allocates colors read- only, which allows it to share colors with other programs. If you use read/write color cells, no other program can use the colors that xv is using, and vice-versa. The major reason to do such a thing is that using read/write color cells allows the Apply function in the xv color editor window to operate much faster. ( +rw forces xv to use read-only color, the default)

(Resource name: rwColor . Type: boolean)

-/+perfect
Makes xv try 'extra hard' to get all the colors it wants. In particular, when -perfect is specified, xv will allocate and install its own colormap if (and only if) it was unable to allocate all the desired colors. This option is not allowed in conjunction with the -root option.

(Resource name: perfect . Type: boolean)

-/+owncmap
Like ' -perfect ', only this option forces xv to always allocate and install its own colormap, thereby leaving the default colormap untouched.

(Resource name: ownCmap . Type: boolean)

-/+stdcmap
Puts xv into Use Std. Colormap mode. All images will be shown dithered using the same set of colors. This lets you run multiple copies of xv to display multiple images simultaneously, and still have enough colors to go around.

(Resource name: useStdCmap . Type: boolean)

-/+cecmap
Specifies whether xv installs the image's colormap in the xv color editor window, as well as in the image's window. By default, the program does not install the colormap in the color editor window, as this often makes the color editor window unreadable. Note, however that the Colormap Editor tool will be appear somewhat misleading. (This option only applies when the ' -perfect ' or ' -owncmap ' options create their own colormaps.)

(Resource name: ceditColorMap . Type boolean)

-/+ninstall
Prevents xv from 'installing' its own colormap, when the -perfect or -owncmap options are in effect. Instead of installing the colormap, it will merely 'ask the window manager, nicely' to take care of it. This is the correct way to install a colormap (i.e., ask the WM to do it), unfortunately, it doesn't actually seem to work in many window managers, so the default behavior is for xv to handle installation itself. However, this has been seen to annoy one window manager ( dxwm), so this option is provided if your WM doesn't like programs installing their own colormaps.

(Resource name: ninstall . Type: boolean)

8/24-Bit Options

See "The 24/8 Bit Menu " for further information about the following options.

-/+8
Locks xv into 8- bit Mode .

(Resource name: force8 . Type: boolean)

-/+24
Locks xv into 24-bit Mode .

(Resource name: force24 . Type: boolean)

The following three options only come into play if you are using xv to display 24-bit RGB data (PPM files, color PM files, JPEG files, the output of bggen, etc.), and you have xv locked into 8-bit Mode , or you save 24-bit image data into an 8-bit graphics file format (such as GIF). They have no effect whatsoever on how GIF pictures or 8-bit greyscale images are displayed.

-quick24
Forces xv to use the 'quick' 24-bit to 8-bit conversion algorithm. This algorithm dithers the picture using a fixed set of colors that span the entire RGB colorspace. In versions of xv prior to 2.10, this was the default algorithm. It no longer is.

(Resource name: quick24 . Type: boolean)

-slow24
Forces xv to use the 'slow' 24-bit to 8-bit conversion algorithm. This algorithm uses a version of Heckbert's median cut algorithm to pick the 'best' colors on a per-image basis, and dithers with those. This is the current default conversion algorithm.

Advantages: The -slow24 algorithm often produces better looking pictures than the -quick24 algorithm.

Disadvantages: The -slow24 algorithm is about half as fast as the -quick24 algorithm. Also, since the colors are chosen on a per-image basis, it can't be used to display multiple images simultaneously, as each image will almost certainly want a different set of 256 colors. The -quick24 algorithm, however, uses the same exact colors for all images, so it can display many images simultaneously, without running out of colors.

(Resource name: slow24 . Type: boolean)

-best24
Forces xv to use the same algorithm used in the program ppmquant, written by Jef Poskanzer. This algorithm also uses a version of Heckbert's median cut algorithm, but is capable of picking 'better' colors than the - slow24 algorithm, and it doesn't dither.

Advantages: Generally produces slightly better images than the -slow24 algorithm. Also, the images are undithered, so they look better when expanded.

Disadvantages: Much slower than the -slow24 algorithm. Like, 5 to 10 times slower. The images produced aren't that much better than those produced by the -slow24 algorithm.

(Resource name: best24 . Type: boolean)

-noqcheck
Turns off a 'quick check' that is normally made. Normally, before running any of the 24-bit to 8-bit conversion algorithms, xv determines whether the picture to be displayed has more than 256 unique colors in it. If the picture doesn't, it will treat the picture as an 8-bit colormapped image (i.e., GIF), and won't run either of the conversion algorithms.

Advantages: The pictures will be displayed 'perfectly', whereas if they went through one of the conversion algorithms, they'd probably be dithered.

Disadvantages: Often uses a lot of colors, which limits the ability to view multiple images at once. (See the -slow24 option above for further info about color sharing.)

(Resource name: noqcheck. Type: boolean)

Root Window Options

xv has the ability to display images on the root window of an X display, rather than opening its own window (the default behavior). When using the root window, the program is somewhat limited, because the program cannot receive input events (keypresses and mouse clicks) from the root window. As a result, you cannot track pixel values, nor crop, nor can you use keyboard commands while the mouse is in the root window.

-/+root
Directs xv to display images in the root window, instead of opening its own window. Exactly how the images will be displayed in the root window is determined by the setting of the -rmode option. Defaults to style '0' if - rmode is not specified.

(Resource name: <none>)

-rmode mode
Determines how images are to be displayed on the root window, when -root has been specified. You can find the current list of 'modes' by using a mode value of '-1'. xv will complain, and show a list of valid modes. The current list at of the time of this writing is:

0:  tiling
1:  integer tiling
2:  mirrored tiling
3:  integer mirrored tiling
4:  centered tiling
5:  centered on a solid background
6:  centered on a 'warp' background
7:  centered on a 'brick' background
8:  symmetrical tiling
9:  symmetrical mirrored tiling

The default mode is '0'. See "Root Display Modes" for a description of the different display modes. Also, if you specify a ' -rmode ' option on the command line, it is not necessary to also specify the ' -root ' option.

(Resource name: rootMode . Type: integer)

-/+noresetroot
Lets you turn off the clearing of the root window that happens when you switch from a 'root' display mode back to the 'window' display mode. Handy if you're trying to create a neat mirrored root tile, and you have to keep adjusting your cropping. Or something like that.

(Resource name: resetroot . Type: boolean)

-rfg color
Sets the 'foreground' color used in some of the root display modes.

(Resource name: rootForeground . Type: string)

-rbg color
Sets the 'background' color used in some of the root display modes.

(Resource name: rootBackground . Type: string)

-/+max
Makes xv automatically stretch the image to the full size of the screen. This is mostly useful when you want xv to display a background. While you could just as well specify the dimensions of your display ('-geom 1152x900' for example), the -max option is display-independent. If you decide to start working on a 1280x1024 display the same command will still work. Note: If you specify -max when you aren't using -root , the behavior is slightly different. In this case, the image will be made as large as possible while still preserving the normal aspect ratio.

(Resource name: <none>)

-/+maxpect
Makes the image as large as possible while preserving the aspect ratio, whether you're in a 'root' mode or not.

(Resource name: <none>)

-/+quit
Makes xv display the (first) specified file and exit, without any user intervention. Since images displayed on the root window remain there until explicitly cleared, this is very useful for having xv display background images on the root window in some sort of start-up script.

If you aren't using a 'root' mode, this option will make xv exit as soon as the user clicks any mouse button in the image window. This is useful if you are calling xv from some other program to display an image.

(Resource name: <none>)

-/+clear
Clears the root window of any xv images. Note: it is not necessary to do an ' xv -clear ' before displaying another picture in the root window. xv will detect that there's an old image in the root window and automatically clear it out (and free the associated colors).

(Resource name: <none>)

Window Options

xv currently consists has several top-level windows, plus one window for the actual image. These windows (the xv controls window, the xv info window, the xv color editor window, the xv comments window, the xv text viewer window, and the xv visual schnauzer) may be automatically mapped and positioned when the program starts.

-/+cmap
Maps the xv controls window.

(Resource name: ctrlMap . Type: boolean)

-cgeom geom
Sets the initial geometry of the xv controls window. Note: only the position information is used. The window is of fixed size.

(Resource name: ctrlGeometry . Type: string)

-/+imap
Maps the xv info window.

(Resource name: infoMap . Type: boolean)

-igeom geom
Sets the initial geometry of the xv info window. Note: only the position information is used. The window is of fixed size.

(Resource name: infoGeometry . Type: string)

-/+cemap
Maps the xv color editor window.

(Resource name: ceditMap . Type: boolean)

-cegeom geom
Sets the initial geometry of the xv color editor window. Note: only the position information is used. The window is of fixed size.

(Resource name: ceditGeometry . Type: string)

-/+cmtmap
Maps the xv comments window.

(Resource name: commentMap . Type: boolean)

-cmtgeometry geom
Sets the initial geometry of the xv comments window.

(Resource name: commentGeometry . Type: string)

-tgeometry geom
Sets the initial geometry for any TextView windows (other than the xv comments window).

(Resource name: textviewGeometry . Type: string)

-/+vsmap
Maps an xv visual schnauzer window.

(Resource name: vsMap . Type: boolean)

-vsgeometry geom
Sets the initial geometry of the xv visual schnauzer windows.

(Resource name: vsGeometry . Type: string)

-/+nopos
Turns off the 'default' positioning of the various xv windows. Every time you open a window, you will be asked to position it. (Assuming your window manager asks you such things. mwm, for instance, doesn't seem to ask)

(Resource name: nopos . Type: boolean)

Image Manipulation Options

-/+dither
When specified, tells xv to automatically issue a Dither command whenever an image is first displayed. Useful on displays with limited color capabilities (4-bit and 6-bit displays), or in conjunction with the ' -ncols ' option.

(Resource name: autoDither . Type: boolean)

-/+smooth
When specified, tells xv to automatically issue a Smooth command whenever an image is first displayed. This is useful when you are using one of the image sizing options (such as ' -expand ' or ' -max ').

(Resource name: autoSmooth . Type: boolean)

-/+raw
Forces xv to display the image in Raw mode. Mainly used to override the autoDither or autoSmooth resources. Can also be used to turn off the automatic dithering and smoothing that occurs when you are using Use Std. Colormap mode or when an image is shrunk to fit the screen.

(Resource name: autoRaw . Type: boolean)

-crop x y w h
Tells xv to automatically crop the specified region of the image. The rectangle is specified in image coordinates, which remain constant (regardless of any expansion/compression of the displayed image). This is useful if you want to view a series of images, and you only want to see one common area of the images. For example, you may have the GIF weather maps of the United States, but only want to display your general region of the country.

(Resource name: <none>)

-/+acrop
When specified, tells xv to automatically issue an AutoCrop command whenever an image is first displayed.

(Resource name: autoCrop . Type: boolean)

-/+4x3
Automatically issues a 4x3 command whenever an image is loaded.

(Resource name: auto4x3 . Type: boolean)

-/+hflip
Automatically issues a 'horizontal flip' command whenever an image is loaded.

(Resource name: autoHFlip . Type: boolean)

-/+vflip
Automatically issues a 'vertical flip' command whenever an image is loaded.

(Resource name: autoVFlip . Type: boolean)

-rotate deg
Automatically rotates the image by the specified amount whenever an image is loaded. deg can be 0, 90, 180, or 270. Positive values rotate the image clockwise, negative values rotate the image counter-clockwise.

(Resource name: autoRotate . Type: integer)

-/+norm
Automatically issues a Norm command (to normalize the contrast of an image) whenever an image is loaded.

(Resource name: autoNorm . Type: boolean)

-/+hist
Automatically issues a HistEq command (to do histogram equalization) whenever an image is loaded.

(Resource name: autoHist . Type: boolean)

-gamma val
Sets the Intensity graph (in the xv color editor window) to the gamma function of the specified value.

(Resource name: <none>)

-cgamma rv gv bv
Sets the Red, Green, and Blue graphs in the xv color editor window to the gamma functions of the specified values.

(Resource name: <none>)

-preset preset
Makes the specified preset (in the xv color editor) the default. It does this by swapping the specified preset ( 1 , 2 , 3 , or 4 ) with the settings associated with the Reset button.

(Resource name: defaultPreset . Type: integer)

Miscellaneous Options

-/+mono
Forces the image to be displayed in greyscale. This is most useful when you are using certain greyscale X displays. While xv attempts to determine if it's running on a greyscale display, many X displays lie, and claim to be able to do color. (This is often because they have color graphics boards hooked up to b/w monitors. The computer, of course, has no way of knowing what type of monitor is attached.) On these displays, if you don't specify -mono , what you will see is a greyscale representation of one of the RGB outputs of the system. (For example, you'll see the 'red' output on greyscale Sun 3/60s.) The -mono option corrects this behavior.

(Resource name: mono . Type: boolean)

-/+rv
Makes xv display a 'negative' of the loaded image. White becomes black, and black becomes white. Color images will have 'interesting' effects, as the RGB components are individually reversed. For example, red (255,0,0) will become cyan (0,255,255), yellow will become blue, and so on.

-white color
Specifies the 'white' color used when the picture is b/w stippled. (When ' -ncols 0 ' has been specified, or when viewing a b/w image.)

(Resource name: white . Type: string)

-black color
Specifies the 'black' color used when the picture is b/w stippled. (When ' -ncols 0 ' has been specified, or when viewing a b/w image.)

Try something like: ' xv -ncols 0 -bl red -wh yellow <filename> ' for some interesting, late-60's- style psychedelia effects.

(Resource name: black . Type: string)

-wait secs
Turns on a 'slide-show' feature. Normally, if you specify multiple input files, xv will display the first one, and wait for you to give the Next command (or whatever). The -wait option makes xv wait for the specified number of seconds, and then go on to the next picture, without any user intervention. The program still accepts commands, so it's possible to 'abort' the current picture without waiting the full specified time by using the Next command.

Note: If you are in Use Std. Colormap mode, and you use -wait 0 , the images will not be dithered (as they normally are when you are in Use Std. Colormap mode). It's assumed that if you said ' -wait 0 ' that you want the images displayed at maximum speed. You can still turn the dithering on if you desire by using the -dither option.

(Resource name: <none>)

-/+wloop
Normally, when running a slide-show with the -wait option, xv will terminate after displaying the last image. If you also specify the -wloop option, the program will loop back to the first image and continue the slide-show until the user issues the Quit command.

(Resource name: <none>)

-/+random
Makes xv display multiple image files in a random order. Useful for breaking up the monotony of having slide-shows always display in the same order. Also, if you also use the -quit option, you can have xv display a single, random file from a list of files. This may be useful if you'd like xv to pick a random 'background image' from some set of files.

(Resource name: <none>)

-/+loadclear
If you were on a PseudoColor display, xv used to automatically clear the image window (and the root window, if using a root mode) whenever you loaded a new image. This was to prevent the potentially annoying/confusing 'rainbow' effect that happens when colormap entries are freed and reallocated with different colors. This has changed. By default, xv no longer clears the image/root window. This is for two reasons: I've decided the rainbow effect is semi-entertaining, in that it gives you something to look at while the next image is being loaded. Secondly, if you are viewing a series of images that have the same colors in them, it's possible for xv to animate them (by using the ' -wait ' command line option), albeit no faster than one frame every 1-2 seconds. For example, you can go get the satellite radar images from vmd.cso.uiuc.edu (in the directory wx ), run ' xv -wait 0 SA* ', and voila! Just like the evening news!

(Resource name: clearOnLoad Type: boolean)

-/+nofreecols
Whenever you load a new image, xv normally frees the colors it was using for the previous image, and allocates new colors for the new image. This can cause 'rainbow' effects on PseudoColor displays as the colors are changed. You can avoid this problem entirely by using the -nofreecols option, which suppresses the normal freeing of old colors. This is most useful when doing slide-shows. Note, however that there will be fewer colors available for 'later' images. These images will wind up being displayed with whatever colors were allocated for the earlier images. As such, they may or may not look that hot... (And allow me to reiterate: xv is not an image animator, despite options like these that let it do so, albeit poorly.)

(Resource name: <none>)

-/+rgb
Specifies that, by default, the colormap editing dials in the xv color editor window should be in RGB mode. This is the normal default behavior.

(Resource name: hsvMode . Type: boolean ( false))

-/+hsv
Specifies that, by default, the colormap editing dials in the xv color editor window should be in HSV mode.

(Resource name: hsvMode . Type: boolean ( true))

-/+lbrowse
Turns on the Browse checkbox in the xv load window. This keeps the window from being automatically closed whenever you successfully load an image.

(Resource name: loadBrowse . Type: boolean)

-/+nostat
Speeds up the performance of the xv load and xv save windows. (Which are really the same window...) It keeps xv from doing a stat() system call for each file in the current directory whenever you change directories. This is handy on systems with a lot remote files, where doing the stat() calls takes too long. One downside: subdirectories will not be shown with the little folder icons, as it requires a stat() call to determine whether a file is a subdirectory or a data file. This will not affect the operation of the program, just the 'niceness'.

(Resource name: nostat . Type: boolean)

-visual vistype
Normally, xv uses the 'best' visual model it can get. It looks for a 24 or 32-bit deep TrueColor, or DirectColor visual. If it can get one, that's what it uses. Otherwise, it will fall back to using the 'default' visual provided by your X server. You can override this bit of cleverness by explicitly selecting a visual to use. Valid types are StaticGray, StaticColor, TrueColor, GrayScale, PseudoColor, DirectColor, and default. All of these modes are not necessarily provided on any given X display. Run xdpyinfo on your display to find out what visual types are supported. You can also specify a specific visual by using its numeric visual ID, in the case that you have multiple instances of a given visual type available ( xv will pick the 'deepest' one by default)

(Resource name: visual . Type: string)

-cursor curs
Specifies an alternate cursor to use in the image window (instead of the normal 'arrow' cursor). curs values are obtained by finding the character number of a cursor you like in the 'cursor' font.

(Run 'xfd -fn cursor' to display the cursor font.) For example, a curs value of '56' corresponds to the (singularly useless) 'Gumby' cursor.

(Resource name: cursor . Type: integer)

-/+2xlimit
By default, xv prevents the image window from ever getting larger than the screen. Unfortunately, because of this, if you load an image that is larger than your screen, the image will be shrunk until it fits on your screen. Some folks find this undesirable behavior. Specifying the -2xlimit option doubles the size limitations. The image window will be kept from getting larger than 2x the width and height of your screen.

Just in case you're wondering why there are any size limitations: it's fairly easy to accidentally ask for a huge image to be generated. Simply Crop a section of the image, zoom so you can see the individual pixels, and UnCrop . If there were no size limitations, the (expanded many times) image could be huge, and might crash your X server. At the very least, it would take a long time to generate and transmit to your X server, and would freeze up your X server during part of it. Generally undesirable behavior.

(Resource name: 2xlimit . Type: boolean)

-/+nolimits
For the truly daring, this turns off all limitations on the maximum size of an image. (Well, there's still an X-imposed maximum size of 64K by 64K, but that really shouldn't be a problem.) Warning: as mentioned above, it is fairly easy to accidentally generate a huge image when you do an UnCrop command, and you may well crash xv, your X server, the host machine, or all three. Use At Your Own Risk!!!

(Resource name: nolimits Type: boolean)

-/+close
If specified, iconifying the xv image window will automatically close all the other xv windows. De-iconifying the xv image window will re-open the other xv windows.

(Resource name: autoClose . Type: boolean)

-/+iconic
Starts xv with its image window iconified.

(Resource name: iconic . Type: boolean)

-icgeometry geom
Specifies the screen position of the icon (when you use the -iconic option).

(Resource name: iconGeometry . Type: string)

-dir directory
Specifies an initial directory for xv to switch to when run.

Also specifies the default directory used for the visual schnauzer and the xv load and xv save windows.

(Resource name: searchDirectory . Type: string)

-flist fname
Tells xv to read a file fname that consists of a list of names of image files to load, one per line. This file is in the same format generated by the File list checkbox in the xv save window. You can use this to get around shell 'command-length' limitations (which can hit you if you try ' xv * ' in a directory with a thousand or two files), or you could have find (or whatever) generate this file based on some type of criteria (age, size, etc.)

(Resource name: fileList . Type: string)

-drift dx dy
A kludge. In order to do certain operations, xv needs to be able to precisely position the contents of an image window on the screen. Unfortunately, window managers disagree wildly on exactly how the "where's the window" information will be presented to the program. The practical upshot is that, despite a sizable effort to the contrary, xv may very will have its image window 'drift' on the screen as you resize it. This option lets you specify correction factors to cancel out the drift. If the window drifts down and to the right, use negative values to cancel the drifting. If the window drifts up and to the left, use positive values to cancel the drifting.

(Resource name: driftKludge . Type: string)

-mfn font
Lets you specify the mono-spaced font used in the TextView windows, and a few other places. Be sure you use a mono-spaced font, or you may well get 'interesting' effects.

(Resource name: monofont . Type: string)

-name string
Lets you change what string is displayed in the titlebar of the image window. Normally, xv will display the version number and the filename. If you're calling xv from another program, you may prefer to have it print a more descriptive string, or perhaps something like '<click mouse to quit>' if you're also using the -quit option.

(Resource name: <none>)

-/+viewonly
For use when calling xv from some other program. Forces all user input to be ignored. This keeps the untrained (or inquisitive) user from nosing around, creating files, or just generally misbehaving. Also note that there's no way for the user to quit the program. It is up to the calling process to manually kill xv when it feels that the image has been displayed long enough.

(Resource name: <none>)

-/+grabdelay seconds
Sets the default 'grab delay' in the Grab dialog box. See "The Grab Command" .

(Resource name: <none>)

-/+poll
Turns file polling on. If enabled, xv will notice when the currently displayed image file changes (due to some other process rewriting it, or something like that), and it will automatically reload the image file once it appears to have settled down (once the file size stops changing for a few seconds). See "Image Reloading" for further details.

(Resource name: <none>)

-/+vsperfect
Normally, the visual schnauzer uses its own private colormap. This is necessary in order to get a good set of colors to display the image icons, and not steal colors away from the actual image window. However, you may find the colormap install/deinstall very annoying. I do. You can specify this option ( +vsperfect ) to turn the 'perfect' behavior off. If you do so, the visual schnauzer windows will steal away a small (64-entry) part of the colormap (unless you are in Use Std. Colormap mode, in which case they will share the standard colormap). The downside is that neither the schnauzer nor the image will look as good.

(Resource name: vsPerfect . Type: boolean)

-/+vsdisable
Completely disables the visual schnauzer. This is mainly so, if you have vsPerfect turned off, you can disable the schnauzer and keep it from stealing any colors from the image. In the default setting ( vsPerfect is turned on), this option will have no useful effect.

(Resource name: vsDisable . Type: boolean)

-gsdev str
Sets the 'device' that the ghostscript package will generate output for, which is used whenever you read a PostScript file in xv. Currently, the default device is ppmraw , which means all PostScript will be converted to either a 24-bit color PPM file, an 8-bit greyscale PGM file, or a 1-bit black- and-white PBM file, as appropriate (based on the particular PostScript file in question). Note that your copy of ghostscript must be configured to support this device, and any other values you may wish to set this option to. See the xv Makefile for further information.

Also note: Be very careful when using these options, as it's pretty easy to have ghostscript generate enormous data files. For example, for normal 8" by 11" pages, at 72dpi, a PBM file will require ~60K per page, a PGM file will require ~500K per page, and a PPM file will require ~1.5M per page. If you have it generate images at 300 dpi (see below), these sizes explode to roughly 1, 8, and 24 megabytes per page. As such, you should forget about viewing color pages at 300 dpi, and you may also want to forget about viewing multi-page PostScript files at 300 dpi.

(Resource name: gsDevice . Type: string)

-gsres res
Specifies the resolution of the page files generated by ghostscript, in dots per inch. Defaults to 72 dpi. You can set it to any value, but be careful about generating enormous intermediate datafiles.

(Resource name: gsResolution . Type: integer)

-gsgeom geom
Sets the page size of the files generated by ghostscript. Normally, this defaults to '612x792', which is the size of 8" by 11" paper, as measured in 72nds of an inch. Note that these numbers are in 72nds of an inch regardless of the resolution (dpi) value set by gsResolution .

(Resource name: gsGeometry . Type: string)

-/+nodecor
Turns off certain decorations on the xv image window's frame, maybe. Works for mwm, at least. There is no way to do this trick with olwm, and twm doesn't need it. Anyway, if you turn off the titlebar and such on the xv image window, it removes the minimum size constraint/problem that I talk about in "Cropping" , and elsewhere.

(Resource name: nodecor Type: boolean)

-RM
If specified, deletes all files specified on the xv command line when xv exits. This can be handy if you're using xv as an external viewer, and you'd like to hand it a file, have it displayed, and then have it go away.

(Resource name: nodecor Type: boolean)

-DEBUG level
Turns on some debugging information. You shouldn't need this. If everything worked perfectly, I wouldn't need this.

(Resource name: <none>)

-
Specifying '-' all by itself tells xv to take its input from stdin , rather than from a file. This lets you put xv on the end of a Unix pipe.

Color Editor Resources

You can set default values for all of the HSV and RGB modification controls in the x v color editor window via X resources. The easiest way to explain this is with an example.

  1. Start xv and put it in the background by typing ' xv & '.
  2. Type the command ' cat >foo ' in an active xterm window
  3. Bring the xv color editor window up.
  4. Issue the Cut Resources command.
  5. Click your middle mouse button in the xterm window. A set of resource lines describing the current state of the xv color editor controls will be 'pasted' into the window.
  6. You could type <ctrl-D> in the xterm to complete the cat command, edit this file, and put it in your .Xdefaults or .Xresources file.

The lines generated by Cut Resources will look like this:

xv.default.huemap1: 330  30  CW 330  30  CW
xv.default.huemap2:  30  90  CW  30  90  CW
xv.default.huemap3:  90 150  CW  90 150  CW
xv.default.huemap4: 150 210  CW 150 210  CW
xv.default.huemap5: 210 270  CW 210 270  CW
xv.default.huemap6: 270 330  CW 270 330  CW
xv.default.whtmap:  0 0 1
xv.default.satval:  0
xv.default.igraf: S 4 : 0,0 : 64,64 : 192,192 : 254,254
xv.default.rgraf: S 4 : 0,0 : 64,64 : 192,192 : 254,254
xv.default.ggraf: S 4 : 0,0 : 64,64 : 192,192 : 254,254
xv.default.bgraf: S 4 : 0,0 : 64,64 : 192,192 : 254,254

These lines completely describe one state of the xv color editor controls. There are five different states that you can specify via X resources. The ' default ' state (as shown) holds the settings used whenever the program is first started, and whenever the Reset command is used. You can also store settings in one of the four xv presets (accessed via the 1, 2, 3, or 4 buttons in the xv color editor) by changing the string ' default ' in the above lines to ' preset1 ', ' preset2 ', ' preset3 ', or ' preset4 ' respectively.

There are four types of resource described in these lines: huemap , whtmap , satval , and graf .

Huemap Resources

The huemap resources describe the state of the hue remapping dials. There are six huemap resources per state of the xv color editor. These huemap resources are numbered ' huemap1 ', through ' huemap6 ', and correspond to the ' 1 '-' 6 ' radio buttons under the hue remapping dials.

Each huemap resources takes six parameters:

  1. The 'starting' angle of the From range, in degrees (integer).
  2. The 'ending' angle of the From range, in degrees (integer).
  3. The direction of the From range. Either ' cw ' (clockwise) or ' ccw ' (counter-clockwise).
  4. The 'starting' angle of the To range, in degrees (integer).
  5. The 'ending' angle of the To range, in degrees (integer).
  6. The direction of the To range. Either ' cw ' or ' ccw '.

Whtmap Resources

The whtmap resource describes the state of the white remapping control. There is one whtmap resource per state of the xv color editor controls. The whtmap resource takes three parameters:

  1. The hue to remap 'white' to, in degrees (integer).
  2. The saturation to give to the remapped 'white', in percent (integer).
  3. A boolean specifying whether the white remapping control is enabled. If '1', the control is enabled. If '0', the control is disabled.

Satval Resource

The satval resource describes the value of the Saturation dial. There is one satval resource per state. The satval resource takes a single integer value, in the range 100, which specifies how much to add or subtract to the overall image color saturation.

Graf Resources

The graf resources describe the state of the four 'graph' windows in the xv color editor window ( Intensity, Red, Green, and Blue). The graf resources can be in one of two formats, 'gamma' and 'spline/line'.

In 'gamma' format, the graf resource takes two parameters:

  1. The letter 'G', specifying 'gamma' mode
  2. A single floating point number specifying the gamma value.

In 'spline/line' mode, the graf resource takes a variable number of parameters:

  1. The letter 'S' specifying 'spline' mode, or the letter 'L' specifying 'line' mode.
  2. An integer number indicating the number of handles (control points) that this graph window will have. (Must be in the range 2-16, inclusive.)
  3. For each handle, there will be a ':', and the x and y positions of the handle, separated by a comma. The x and y positions can be in the range 0-255 inclusive.

Other Resources

autoApply
A boolean resource that sets the default condition of the Auto-Apply HSV/RGB Mods checkbox in the xv color editor window.
displayMods
A boolean resource that sets the default condition of the Display With HSV/RGB Mods checkbox in the xv color editor window.
dragApply
A boolean resource that sets the default condition of the Auto-Apply While Dragging checkbox in the xv color editor window.
autoReset
A boolean resource that sets the default condition of the Auto-Reset On New Image checkbox in the xv color editor window.
saveNormal
A boolean resource that sets the default condition of Normal Size checkbox in the xv save window.
pspreview
A boolean resource that sets the default condition of Preview checkbox in the xv postscript window.
pscompress
A boolean resource that sets the default condition of Compress checkbox in the xv postscript window.
print
A string resource that sets the default command that shows up in the Print dialog box.
pspaper
A string resource that sets the default paper size selected in the xv postscript window. Valid settings are: 8.5x11, 8.5x14, 11x17, 4x5 35mm a3 a4 b5
psorient
A string resource that sets the default image orientation in the xv postscript window. Valid settings are: portrait and landscape
psres
An integer resource that sets the default image resolution in the xv postscript window. Valid settings are in the range 10 through 720 dpi.

Window Classes

xv defines the following 'class' names for its various top-level windows:

XVroot
for the xv image window
XVcontrols
for the xv controls window
XVdir
for the xv load and xv save windows
XVinfo
for the xv info window
XVcedit
for the xv color editor window
XVps
for the xv postscript window
XVjpeg
for the xv jpeg window
XVtiff
for the xv tiff window
XVconfirm
for all the pop-up windows

You may be able to use these class names to do something nifty with your window manager. For instance, with mwm you can control which controls you'll get in the window frame, on a per-window basis. For example, to turn off all the mwm doodads that normally are tacked onto the xv image window, you could put this in your .Xdefaults file:

Mwm*XVroot*clientDecoration: none


This document was extracted from the PostScript documentation and formatted by Roy Johnson. Much of the process was automated, and may therefore have introduced errors. Corrections are appreciated.