|
NAMExloadimage, xsetbg, xview - load images into an X11 window or onto the root windowSYNOPSISxloadimage [global_options] {[image_options] image ...}xloadimage [global_options] [image_options] stdin < image DESCRIPTIONXloadimage displays images in an X11 window, loads them onto the root window, or writes them into a file. Many image types are recognized; use the -supported option to list them.If the filename stdin is given, xloadimage will read the image from standard input if this capability is supported by the loader for that image type (most types do support reading from stdin). If the destination display cannot support the number of colors in the image, the image will be dithered (monochrome destination) or have its colormap reduced (color destination) as appropriate. This can also be done forcibly with the -halftone, -dither, and -colors options. A variety of image manipulations can be specified, including gamma correction, brightening, clipping, dithering, depth‐reduction, rotation, and zooming. Most of these manipulations have simple implementations; speed was opted for above accuracy. If you are viewing a large image in a window, the initial window will be at most 90% of the size of the display unless the window manager does not correctly handle window size requests or if you've used the -fullscreen option. You may move the image around in the window by dragging with the first mouse button. The cursor will indicate which directions you may drag, if any. You may exit the window by typing 'q' or '^C' when the keyboard focus is on the window. If more than one image file is specified on the command line, each image will be shown in order (except if -merge or -goto are being used). A wide variety of common image manipulations can be done by mixing and matching the available options. See the section entitled HINTS FOR GOOD IMAGE DISPLAYS for some ideas. The -dump option causes an image to be written to a file rather than displayed after processing. This allows you to read an image, perform a number of processing operations on it, and save the resultant image. This also allows translation from any of the recognized image types into any of the formats that support dumping. Xsetbg is equivalent to xloadimage -onroot -quiet and xview is equivalent to xloadimage -view -verbose. RESOURCE CLASSXloadimage uses the resource class name Xloadimage for window managers which need this resource set. This name changed in version 2.00 and 2.01; some previous versions used the name XLoadImage (which was difficult to predict) or xloadimage (which conflicted with class naming conventions).GLOBAL OPTIONSThe following options affect the global operation of xloadimage. They may be specified anywhere on the command line. Additionally the -global option can be used to force an image option to apply to all images.
IMAGE OPTIONSThe following options may precede each image. These options are local to the image they precede.
EXAMPLESTo load the rasterfile "my.image" onto the background and replicate it to fill the entire background:xloadimage -onroot my.image To center an image on the default root background: xloadimage -default -tile my.image If using a monochrome display and a color image you will probably want to dither the image for a cleaner (and faster) display: xloadimage -default -tile -dither my.image To load a monochrome image "my.image" onto the background, using red as the foreground color, replicate the image, and overlay "another.image" onto it at coordinate (10,10): xloadimage -foreground red my.image -at 10,10 another.image To center the rectangular region from 10 to 110 along the X axis and from 10 to the height of the image along the Y axis: xloadimage -center -clip 10,10,100,0 my.image To double the size of an image: xloadimage -zoom 200 my.image To halve the size of an image: xloadimage -zoom 50 my.image To brighten a dark image: xloadimage -brighten 150 my.image To darken a bright image: xloadimage -brighten 50 my.image HINTS FOR GOOD IMAGE DISPLAYSSince images are likely to come from a variety of sources, they may be in a variety of aspect ratios which may not be supported by your display. The -xzoom and -yzoom options can be used to change the aspect ratio of an image before display. If you use these options, it is recommended that you increase the size of one of the dimensions instead of shrinking the other, since shrinking looses detail. For instance, many GIF and G3 FAX images have an X:Y ratio of about 2:1. You can correct this for viewing on a 1:1 display with either -xzoom 50 or -yzoom 200 (reduce X axis to 50% of its size and expand Y axis to 200% of its size, respectively) but the latter should be used so no detail is lost in the conversion.When zooming color images up you can reduce blockiness with -smooth. For zooms of 300% or more, I recommend two smoothing passes (although this can take awhile to do on slow machines). There will be a noticeable improvement in the image. You can perform image processing on a small portion of an image by loading the image more than once and using the -merge, -at and -clip options. Load the image, then merge it with a clipped, processed version of itself. To brighten a 100x100 rectangular portion of an image located at (50,50), for instance, you could type: xloadimage my.image -merge -at 50,50 -clip 50,50,100,100 -brighten 150 my.image If you're using a display with a small colormap to display colorful images, try using the -gray option to convert to grayscale. PATHS AND EXTENSIONSThe file ~/.xloadimagerc (and optionally a system-wide file) defines a number of configuration options that affect xloadimage.This file is split into three section, the path section, the extension section, and the filter section. The sections are identified by typing the section name followed by an equals sign, eg "path =". The path statement is used to provide a set of search paths to use when looking for an image of a specified name. Separate each path in the list by whitespace (eg one or more spaces, tabs, or newlines). The path is searched in the order it is specified. For example: path = ~/images /usr/local/images ~fred will first look for the image name you specified, then look for the name in ~/images (the tilde is expanded to the value of $HOME), then in /usr/local/images, then in user fred's home directory. This allows easy use of image repositories. The extension statement is used to provide a set of default extensions to use when looking for an image of a specified name. Separate each extension in the list by whitespace. The extensions are searched in the order in which they are specified. For example: extension = .gif .jpg If you have a file named myimage.gif you could specify the name myimage and xloadimage would append the .gif extension automatically. The filter statement is used to describe filter programs, such as "uncompress", which are to be applied to image files automatically. You specify one filter program and any number of recognized extensions following the filter keyword. For example: filter = uncompress .Z specifies that the program uncompress should be used as a filter whenever an image file has a .Z extension. By default filters are provided for compressed (.Z) files and GNU zip (.gz) files. See the FILTERS section for more information on defining your own filters. Any text on a line following a hash‐mark (#) is ignored; if you wish to use a hash‐mark in a path, extension, or filter you can escape it using a backslash (\). If you wish to include white-space in a filter program name, path, or extension you can enclose the entire text in double‐quotes. For example: filter = "gzip -cd" .gz Use backslash (\) characters to allow inclusion of double‐quote marks or newlines. The following is a sample ~/.xloadimagerc file: # paths to look for images in path = /usr/local/images # system image repository ~/images # personal images /usr/local/include/X11/bitmaps # standard X bitmaps # default extensions for images extension = .csun .msun .sun .face .xbm .bm # invoke GNU zip if a .z or .zip extension is found filter = "gzip -cd" .z .zip IMAGE TYPESXloadimage currently supports many common and some uncommon image types, and can create images in several formats. For a complete list use the -supported option.DUMPING IMAGESSeveral image dumpers are included that can be used to create a new image after loading and processing. The NIFF (Native Image File Format) is the simplest and creates images that xloadimage can read the fastest; it is essentially a copy of the internal image format.Some image dumpers allow options that affect the image output. These options are appended to the image type following a comma and are separated by commas. If a value is desired it can be specified following an equals‐sign. For example, to create a monochrome JPEG image file with a quality factor of 80, you would use the following command line: xloadimage image_name -dump jpeg,quality=80,grayscale new_image.jpg Option names can be abbreviated but if the abbreviation is too short to be unique the option which will be used is indeterminate. FILTERSXloadimage supports automatic filtering by recognizing file extensions. By default "compress" and "gzip" files are recognized and their names passed to appropriate commands to decompress them.The xloadimage distribution includes a special "smart" uudecoder, called uufilter that can be used to automatically uudecode files for processing. Uufilter ignores extraneous lines in the file so it is particularly useful if the uuencoded file was created by concatenating email or news postings that had headers or line‐break indicators included. To make use of uufilter you can add the following to your .xloadimagerc file: filter = "uufilter -s" .uu .uueThe filter will be automatically invoked on any file with a .uu or .uue extension. For a list of filters automatically recognized by xloadimage use the -configuration option. SUPPORTED IMAGE OPTIONSThe JPEG image dumper supports the following options:
If you are not familiar with the meaning of these options you can ask the Independent JPEG Group (IJG) via email at jpeg@cs.columbia.edu. The PBM image dumper supports the following options:
There is no way to dump a PGM format file or a "compact" PBM format file (sorry). The TIFF image dumper supports the following options:
Xloadimage will save using the MINISBLACK, MINISWHITE, COLORMAP, or RGB photometrics as appropriate for its internal image format. There is no way to specify a particular photometric or any other TIFF fields. AUTHORJim Frost CenterLine Software jimf@centerline.com For a more‐or‐less complete list of other contributors (there are a lot of them), please see the README file enclosed with the distribution. FILES
COPYRIGHTCopyright (c) 1989, 1993 Jim Frost and others.Xloadimage is copyrighted material with a very loose copyright allowing unlimited modification and distribution if the copyright notices are left intact. Various portions are copyrighted by various people, but all use a modification of the MIT copyright notice. Please check the source for complete copyright information. The intent is to keep the source free, not to stifle its distribution, so please write to me if you have any questions. BUGSZooming dithered images, especially downwards, is UGLY.Images can come in a variety of aspect ratios. Xloadimage cannot detect what aspect ratio the particular image being loaded has, nor the aspect ratio of the destination display, so images with differing aspect ratios from the destination display will appear distorted. See HINTS FOR GOOD IMAGE DISPLAYS for more information. The GIF format allows more than one image to be stored in a single GIF file, but xloadimage will only display the first. Only GIF87a format is supported. One of the pseudonyms for xloadimage, xview, is the same name as Sun uses for their SunView‐under‐X package. This will be confusing if you're one of those poor souls who has to use Sun's XView. Some window managers do not correctly handle window size requests. In particular, many versions of the twm window manager use the MaxSize hint instead of the PSize hint, causing images which are larger than the screen to display in a window larger than the screen, something which is normally avoided. Some versions of twm also ignore the MaxSize argument's real function, to limit the maximum size of the window, and allow the window to be resized larger than the image. If this happens, xloadimage merely places the image in the upper‐left corner of the window and uses the zero‐value'ed pixel for any space which is not covered by the image. This behavior is less‐than‐graceful but so are window managers which are cruel enough to ignore such details.
Visit the GSP FreeBSD Man Page Interface. |