XLI(1)
π NAME π
ok so bestie, <rainbow>xli</rainbow> β it loads images into an X11 window or slaps them straight onto the root window. that's the whole vibe β¨
π SYNOPSIS π
xli [global_options] {[image_options] image ...}
xli [global_options] [image_options] stdin < image
π¦ DESCRIPTION π¦
xli displays images in an X11 window, or loads them onto the root window. wanna know which image types it fucks with? the IMAGE TYPES section down below has you covered, babes.
if you hand it the filename stdin, xli will read the image from standard input. iconic, honestly.
ok so here's the tea: 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. and yes you can force this yourself with the -halftone, -dither, and -colors options. do with that what you will π
a whole 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. like, it's fast, it's not trying to be a museum, ok?
if you're viewing a large image in a window, the initial window will be at most 90% of the size of the display β unless your window manager doesn't correctly handle window size requests, or unless you've used the -fullscreen or -fillscreen options. you can 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. little cursor hints? we love a considerate king π«Ά
when the keyboard focus is in the window you can:
- Type
qor^Cto exitxli. bye bestie π - Type space,
norfto move to the next image in the list. - Type
borpto move to the previous image in the list. - Type
.to reload the image. - Type
lto rotate the image anti-clockwise. - Type
rto rotate the image clockwise. - Type
0to set the images assumed gamma to your display gamma (usually darkens images) - Type
1to set the images assumed gamma to1.0(usually lightens images) - Type
5-2to lighten the image (5in small steps, up to2in large steps) - Type
6-9to darken the image (6in small steps, up to9in large steps) - Type
>resp.<to zoom in resp. out
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. go crazy, chef π
πΈ RESOURCE CLASS πΈ
xli uses the resource class name _XSETROOT_Id for window managers which need this resource set. niche? yes. necessary? also yes, for the girlies running those WMs π
β¨ GLOBAL OPTIONS β¨
the following options affect the global operation of xli. they may be specified anywhere on the command line. no rules, just vibes.
-defaultβ Set the root background to the default root weave. This is the same asxsetrootwith no arguments. boring but it slays in its own quiet way.-debugβ Talk to the X server in synchronous mode. This is useful for debugging. If an X error is seen while in this mode, a core will be dumped. not a drill.-dumpcoreβ Signals will not be trapped, and instead a coredump will occur. living dangerously, I see π-displaydisplay_name β X11 display name to send the image(s) to.-dispgammaDisplay_gamma β Specify the gamma correction value appropriate for the display device. This overrides the value read from the environment variableDISPLAY_GAMMA, or the default value of2.2, which is approximately correct for many displays. A value of between1.6and2.8is reasonable. If individual images are too bright or dark, use the-gammaoption.
there is an image provided with xli called chkgamma.jpg that lets you set the display gamma reasonably accurately. This file contains two grayscale ramps. The ramps are chosen to look linear to the human eye, one using continuous tones, and the other using dithering. When the display gamma is correct, then the two ramps should look symmetrical, and the point at which they look equally bright should be almost exactly half way from the top to the bottom. (To find this point it helps if you move away a little from the screen, and de-focus your eyes a bit.) yes this is real advice, no I'm not making it up, yes it's basically a vibe check for your monitor
if the equal brightness point is above center increase the gamma, and decrease it if it is below the center. The value will usually be around 2.2. Once you've got it right, you can set the DISPLAY_GAMMA environment variable in your .profile. set it and forget it, periodt β¨
-fillscreenβ Use the whole screen for displaying an image. The image will be zoomed so that it just fits the size of the screen. If-onrootis also specified, it will be zoomed to completely fill the screen.-fitβ Force image to use the default visual and colormap. This is useful if you do not want technicolor effects when the colormap focus is inside the image window, but it may reduce the quality of the displayed image. This is on by default if-onrootor-windowidis specified.-forallβ Apply-fillscreenand-fullscreenoptions to all images and not just the first. everybody eats π-forkβ Forkxli. This causesxlito disassociate itself from the shell. This option automatically turns on-quiet. sneaky little side effect but ok.-fullscreenβ Use the whole screen for displaying an image. The image will be surrounded by a border if it is smaller than the screen. If-onrootis also specified, the image will be zoomed so that it just fits the size of the screen.-geometryWxH[{+-X}{+-}Y] β This sets the size of the window onto which the images are loaded to a different value than the size of the image. When viewing an image in a window, this can be used to set the size and position of the viewing window. If the size is not specified in the geometry, (or is set to0), then the size will be chosen to be small enough to able to fit the window in the screen (as usual).-gotoimage_name β When the end of the list of images is reached, go to image image_name. This is useful for generating looped slideshows. If more than one image of the same name as the target exists on the argument list, the first in the argument list is used.-help[option ...] β Give information on an option or list of options. If no option is given, a simple interactive help facility is invoked. it's like a little help bestie π«Ά-identifyβ Identify the supplied images rather than display them. tell me who she is π-installβ Forcibly install the images colormap when the window is focused. This violates ICCCM standards and only exists to allow operation with naive window managers. Use this option only if your window manager does not install colormaps properly. read that again, bestie.-listβ List the images which are along the image path.-onrootβ Load image(s) onto the root window instead of viewing in a window. This option automatically sets the-fitoption. This is the opposite of-view. If used in conjunction with-fullscreen, the image will be zoomed to just fit. If used with-fillscreen, the image will be zoomed to completely fill the screen.-border,-at, and-centeralso affect the results.-pathβ Displays the image path and image suffixes which will be used when looking for images. These are loaded from~/.xlircand optionally from a system wide file (normally/usr/lib/xlirc). your config, your rules π-pixmapβ Force the use of a pixmap as backing-store. This is provided for servers where backing-store is broken (such as some versions of the AIXWindows server). It may improve scrolling performance on servers which provide backing-store.-privateβ Force the use of a private colormap. Normally colors are allocated shared unless there are not enough colors available.-quietβ Forcesxliandxviewto be quiet. π€«-supportedβ List the supported image types.-verboseβ Causesxlito be talkative, telling you what kind of image it's playing with and any special processing that it has to do. This is the default forxviewandxli. she's a yapper, it's her nature π-versionβ Print the version number and patchlevel of this version ofxli.-viewβ View image(s) in a window. This is the opposite of-onrootand the default forxviewandxli.-visualvisual_name β Force the use of a specific visual type to display an image. Normallyxlitries to pick the best available image for a particular image type. The available visual types are:DirectColor,TrueColor,PseudoColor,StaticColor,GrayScale, andStaticGray. Nonconflicting names may be abbreviated and case is ignored.-windowidhex_window_id β Sets the background pixmap of a particular window ID. The argument must be in hexadecimal and must be preceded by"0x"(eg-windowid 0x40000b. This is intended for setting the background pixmap of some servers which use untagged virtual roots (eg HP-VUE), but can have other interesting applications. yes that parenthesis is just like that, we don't fix what isn't ours β¨
β¨ PERSISTENT IMAGE OPTIONS β¨
okay so these next ones? they're the persistent ones, bestie. You can put them before any image, and they'll kick in starting from the next image and keep going until you override them or cancel them with -newoptions. π
-bordercolor β Sets the background part of the window (or clipped image) that isn't covered by any images to be color. π-brightenpercentage β Give a percentage multiplier for the colormap of a color image. Over 100 = brighter, under 100 = darker. β¨-colorsn β Set the max number of colors to use in the image. It's a way to forcibly reduce the depth of an image. π-cditherβ Dither the image with a Floyd-Steinberg dither if the number of colors is reduced. This is slow but gives a better looking result with a restricted color set. π¦-colorditherβ Same as-cdither. They're literally equivalent. No cap. π-delaysecs β Sets xli to automatically advance to the following image secs seconds after the next image file is displayed. β³-ditherβ Dither a color image to monochrome using a Floyd-Steinberg dithering algorithm. This happens by default when viewing color images on a monochrome display. It's slower than-halftoneand affects image accuracy but usually looks much better. π-gammaImage_gamma β Specify the gamma of the display the image was intended to be displayed on. Images seem to come in two flavors: 1) linear color images, produced by ray tracers, scanners, etc. These generally look too dark when displayed directly to a CRT display. 2) Images that have been processed to look right on a typical CRT display without any sort of processing. These images have been 'gamma corrected'. By default, xli assumes that 8 bit images have been gamma corrected and need no other processing. 24 bit images are assumed to be linear. If a linear image is displayed as if it is gamma corrected, it will look too dark, and a gamma value of 1.0 should be specified so that xli can correct the image for the CRT display device. If a gamma corrected image is displayed as if it were a linear image, then it will look too light, and a gamma value of (approximately) 2.2 should be specified for that image. Some formats (RLE) allow the image gamma to be embedded as a comment in the file itself, and the-gammaoption allows overriding of the file comment. In general, values smaller than 2.2 will lighten the image, and values greater than 2.2 will darken the image. In general this will work better than the-brightenoption. π₯-grayβ Convert an image to grayscale. Very useful when displaying colorful images on servers with limited color capability. The optional spelling-greymay also be used. πΈ-idelaysecs β Set the delay to be used for this image to secs seconds (see-delay). If-delaywas specified, this overrides it. If it was not specified, this sets the automatic advance delay for this image while others will wait for the user to advance them. π-smoothβ Smooth a color image. Reduces blockiness after zooming an image up. If used on a monochrome image, nothing happens. This option can take a while to perform, especially on large images. You may specify more than one-smoothoption per image, causing multiple iterations of the smoothing algorithm. π§-titlewindow_title β Set the titlebar of the window used to display the image. This overrides any title read from the image file. The title will also be used for the icon name. π-xpmcolor_context_key β Select the preferred xpm colour map. XPM files may contain more than one color mapping, each mapping being appropriate for a particular visual. Normally xli will select an appropriate color mapping from that supported by the XPM file by checking on the default X visual class and depth. This option allows the user to override this choice. Legal values of color_context_key are:m,g4,g, andc.m= mono,g4= 4 level gray,g= gray,c= color ). π-xzoompercentage β Zoom the X axis of an image by percentage. A number greater than 100 will expand the image, one smaller will compress it. A zero value will be ignored. This option, and the related-yzoom, are useful for correcting the aspect ratio of images to be displayed. π-yzoompercentage β Zoom the Y axis of an image by percentage. See-xzoomfor more information. π-zoompercentage β Zoom both the X and Y axes by percentage. See-xzoomfor more information. Technically the percentage actually zoomed is the square of the number supplied since the zoom is to both axes, but the author opted for consistency instead of accuracy. π-zoom autoβ Zoom large images to fit the screen; don't zoom small images. β¨-newoptionsβ Reset options that propagate. The-bright,-colors,-colordither,-delay,-dither,-gamma,-gray,-normalize,-smooth,-xzoom,-yzoom, and-zoomoptions normally propagate to all following images. π«Ά
πΈ LOCAL IMAGE OPTIONS πΈ
These ones? They can also go before any image, but they only affect the image they're right in front of. Local vibes only, bestie. π
-atX,Y β Indicates coordinates to load the image at X,Y on the base image. If this is an option to the first image, and the-onrootoption is specified, the image will be loaded at the given location on the display background. π―-backgroundcolor β Use color as the background color instead of the default (usually white but this depends on the image type) if you are transferring a monochrome image to a color display. π-centerβ Center the image on the base image loaded. If this is an option to the first image, and the-onrootoption is specified, the image will be centered on the display background. π-clipX,Y,W,H β Clip the image before loading it. X and Y define the upper-left corner of the clip area, and W and H define the extents of the area. A zero value for W or H will be interpreted as the remainder of the image. Note that X and Y may be negative, and that W and H may be larger than the image. This causes a border to be placed around the image. The border color may be set with the-borderoption. βοΈ-expandβ Forces the image (after all other optional processing) to be expanded into a True Color (24 bit) image. This is useful on systems which support 24 bit color, but where xli might choose to load a bitmap or 8 bit image into one of the other smaller depth visuals supported on your system. π₯-foregroundcolor β Use color as the foreground color instead of black if you are transferring a monochrome image to a color display. This can also be used to invert the foreground and background colors of a monochrome image. π€-halftoneβ Force halftone dithering of a color image when displaying on a monochrome display. This option is ignored on monochrome images. This dithering algorithm blows an image up by sixteen times; if you don't like this, the-ditheroption will not blow the image up but will take longer to process and will be less accurate. π₯-invertβ Inverts a monochrome image. This is shorthand for-foreground white -background black. π-mergeβ Merge this image onto the base image after local processing. The base image is considered to be the first image specified or the last image that was not preceded by-merge. If used in conjunction with-atand-clip, very complex images can be built up. Note that the final image will be the size of the first image, and that subsequent merged images overlay previous images. The final image size can be altered by using the-clipoption on the base image to make it bigger or smaller. This option is on by default for all images if the-onrootor-windowidoptions are specified. π§©-nameimage_name β Force the next argument to be treated as an image name. This is useful if the name of the image is-dither, for instance. π·οΈ-normalizeβ Normalize a color image. βοΈ-rotatedegrees β Rotate the image by degrees clockwise. The number must be a multiple of 90. π
π EXAMPLES π
okay bestie, let's see this in action. Here are some iconic examples:
- To load the rasterfile
"my.image"onto the background and replicate it to fill the entire background:
xli -onroot 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):
xli -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:
xli -center -clip 10,10,100,0 my.image
- To double the size of an image:
xli -zoom 200 my.image
- To halve the size of an image:
xli -zoom 50 my.image
- To brighten a dark image:
xli -brighten 150 my.image
- To darken a bright image:
xli -brighten 50 my.image
π HINTS FOR GOOD IMAGE DISPLAYS π
okay bestie, real talk: images come from everywhere, and they show up in every aspect ratio imaginable, and your display might not vibe with any of them. that's what -xzoom and -yzoom are for β they change the aspect ratio of an image before it hits your screen. and here's the tea: if you use them, pls pls increase one of the dimensions instead of shrinking the other, because shrinking loses detail. π«Ά
for example, so many GIF and G3 FAX images have an X:Y ratio of about 2:1. you can fix that for a 1:1 display with either -xzoom 50 or -yzoom 200 (that's "reduce X axis to 50% of its size" and "expand Y axis to 200% of its size" respectively) β but use the latter, okay? so no detail is lost in the conversion. π
when you're zooming color images up, you can reduce that blockiness with -smooth. for zooms of 300% or more, the recommendation is two smoothing passes (though ngl, this can take awhile on slow machines). there will be a noticeable improvement in the image. slay. β¨
you can also do image processing on just 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:
xli my.image -merge -at 50,50 -clip 50,50,100,100 -brighten 150
my.image
and if you're using a display with a small colormap to show off colorful images? try the -gray option to convert to grayscale. πβ‘οΈπ©Ά
π§ XLITO π§
xlito (XLoadImageTrailingOptions) is a whole separate utility that gives you a file-format-independent way of marking image files with the appropriate options so they display correctly. it does this by appending to file a string specified by the user, marked with some magic numbers so that this string can be extracted by a program that knows where to look. π
and because almost all image files have some sort of image size specifier, the programs that load or manipulate these files do not look beyond the point at which they have read the image β so trailing information can safely be appended to the file. and if appending this information causes trouble with other utilities, it can simply be deleted. no biggie. π
xli will recognize these trailing options at the end of the image files, and will treat the embedded string as if it were a sequence of command line IMAGE OPTIONS. Any GLOBAL OPTIONS will be ignored, and the IMAGE OPTIONS are never propagated to other images.
trailing options can be examined with:
xlito image_file ...
changed or added with:
xlito -c "string of options" image_file
and deleted with:
xlito -d image_file ...
for example, if you have a gif file fred.gif which is too dark and is the wrong aspect ratio, then it may need to be viewed with:
xli -yzoom 130 -gamma 1.0 fred.gif
to get it to look OK. these options can then be appended to the file by:
xlito -c "-yzoom 130 -gamma 1.0" fred.gif
and from then on xli will get the appropriate options from the image file itself. see the xlito manual entry for more details about this utility. π
π€οΈ PATHS AND EXTENSIONS π€οΈ
the file ~/.xlirc (and optionally a system-wide file) defines the path and default extensions that xli will use when looking for images. this file can have two statements: "path=" and "extension=" (and the equals signs must follow the word with no spaces between β periodt).
everything following the "path=" keyword will be prepended to the supplied image name if the supplied name does not specify an existing file. the paths will be searched in the order they are specified. π
everything following the "extension=" keyword will be appended to the supplied image name if the supplied name does not specify an existing file. as with paths, these extensions will be searched in the order they are given. comments are any portion of a line following a hash-mark (#).
the following is a sample ~/.xlirc file:
# paths to look for images in
path= /usr/local/images
/home/usr1/guest/madd/images
/usr/include/X11/bitmaps
# default extensions for images; .Z is automatic; scanned in order
extension= .csun .msun .sun .face .xbm .bm
β οΈ lore drop: versions of xli prior to version 01, patchlevel 03 would load the system-wide file (if any), followed by the user's file. this behavior made it difficult for the user to configure her environment if she didn't want the default. newer versions will ignore the system-wide file if a personal configuration file exists. glow up fr fr. π
πΌοΈ IMAGE TYPES πΌοΈ
xli currently supports the following image types:
- CMU Window Manager raster files
- Faces Project images
- Fuzzy Bitmap (
.fbm) images - GEM bit images
- GIF images (Including GIF89a compatibility)
- G3 FAX images
- JFIF style jpeg images
- McIDAS areafiles
- MacPaint images
- Windows, OS/2 RLE Image
- Monochrome PC Paintbrush (
.pcx) images - Photograph on CD Image
- Portable Bitmap (
.pbm,.pgm,.ppm) images - Sun monochrome rasterfiles
- Sun color RGB rasterfiles
- Targa (
.tga) files - Utah Raster Toolkit (
.rle) files - X pixmap (
.xpm) files (Version 1, 2C and 3) - X10 bitmap files
- X11 bitmap files
- X Window Dump (except TrueColor and DirectColor)
Normal, compact, and raw PBM images are supported. Both standard and run-length encoded Sun rasterfiles are supported. π₯
any image whose name ends in .Z is assumed to be a compressed image and will be filtered through "uncompress". if HAVE_GUNZIP is defined in the Makefile.std make file, then any image whose name ends in .gz or .Z will be filtered through gunzip. ποΈ
and any file that looks like a uuencoded file will be decoded automatically. iconic behavior honestly. β¨
π AUTHORS π
the original Author is:
Jim Frost
Saber Software
jimf@saber.com
Version 1.16 of xli is derived from xloadimage 3.01 has been brought to you by:
Graeme Gill
graeme@labtam.oz.au
Version 1.17 of xli is derived from xli 1.16 by
smar@reptiles.org
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 π
xli - the image loader and viewer
xlito - the trailing options utility
/usr/lib/X11/Xli - default system-wide configuration file
~/.xlirc - user's personal configuration file
βοΈ COPYRIGHT βοΈ
Copyright (c) 1989, 1990, 1991, 1992, 1993 Jim Frost, Graeme Gill and others.
Xli is copyrighted material with a very loose license 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. π
π BUGS π
Zooming dithered images, especially downwards, is UGLY. like, not even in a cute way. π
Images can come in a variety of aspect ratios. Xli 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. the solution to this is to use xlito to append the appropriate options to the image file. see HINTS FOR GOOD IMAGE DISPLAYS and XLITO for more information.
The GIF format allows more than one image to be stored in a single GIF file, but xli will only display the first. π
One of the pseudonyms for xli, 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, xli 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. π
The order in which operations are performed on an image is independent of the order in which they were specified on the command line. wherever possible I tried to order operations in such a way as to look the best possible (zooming before dithering, for instance) or to increase speed (zooming downward before compressing, for instance). β‘
Display Gamma should setable in the ~/.xlirc file.
Embedded trailing options override the command line Image Options. Command line options should really override trailing options.
π and that's the whole page bestie!! this one's from 28 Oct 2002, tagged XLI(1) β old school but still serving looks. go forth and display images, you absolute icon. πβ¨π¦πΈπ
π¦ where this page comes from
- debian bookworm: xli 1.17.0+20061110-8 Β· MIT-variant
- debian trixie: xli 1.17.0+20061110-10 Β· MIT-variant
- ubuntu jammy: xli 1.17.0+20061110-6 Β· MIT-variant
- ubuntu noble: xli 1.17.0+20061110-9 Β· MIT-variant
- ubuntu questing: xli 1.17.0+20061110-10
- ubuntu resolute: xli 1.17.0+20061110-10.1 Β· MIT-variant
- ubuntu stonking: xli 1.17.0+20061110-10.1 Β· MIT-variant
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms