xgif(1X) xgif(1X)
NAME
xgif - displays GIF (*) pictures on X11 displays
SYNTAX
xgif [display] [ [-g] geometry] [-e expansion] [-s strip] [-ns]
[filename]
DESCRIPTION
xgif is an X11 program that displays GIF pictures on an 8-plane
display.
OPTIONS
The '-e' option allows you to expand the picture by an integer amount.
For example, viewing a 320x200 picture with an expansion factor of '2'
will result in a 640x400 picture, each pixel of which is a 2x2 block.
You may also specify an expansion of the picture by specifying the
size of the window in the geometry option. This also allows you
specify non-integer expansion factors, and different aspect ratios.
Example: if you view a 320x200 picture, but specify a window size of
640x300, the picture will be expanded by a factor of two along the X-
axis, but only by a factor of 1.5 along the Y-axis.
If you specify both the '-e' option and a window size (via geometry),
the '-e' will be ignored.
The '-s' option allows you specify the number of bits to strip off of
the colors. The theory runs like this: if you have 256 unique colors
in your GIF file, you will almost certainly be unable to allocate all
of them on an 8-plane display, as a couple colors will already be
allocated for the window manager, and such. Setting this option
allows you to strip off the low strip bits of the R,G,B entries in the
GIF colormap. This will have the desired effect of making some of the
(previously different) colors the SAME, and you will be able to
allocate all the colors you need now.
You shouldn't ever HAVE to set this option, because if the program is
unable to allocate the required colors, it will try again after
incrementing strip. You can, however save some time, or alternately
get neat visual effects by setting this option.
The '-ns' option turns off the 'auto-strip' feature described above.
You use this to FORCE the program to use as many colors as possible.
The theory works like this: if you have 256 unique colors in your GIF
file, you will probably be able to allocate all but a few of them.
Rather than stripping off bits, decreasing the color resolution for
the whole picture uniformly, the the 'closest' colors that were
allocated. This may cause nasty 'blotches' on the picture. Then
again, it might not. Only way to tell is to try both with and without
the 'auto-strip' 'feature'.
- 1 - Formatted: December 14, 2025
xgif(1X) xgif(1X)
One DEFINITE drawback of the '-ns' option is that it's only really
useful on the FIRST picture you try to display. If you try to display
two pictures simultaneously, the first picture will (presumably) use
up most (if not ALL) of the colortable, leaving NO colors for the
second picture. Therefore, the second (and succeeding pictures) will
probably not look very good. When you use the 'auto-strip' feature,
you will be able to get considerably more pictures on the screen
simultaneously. Probably. Varies wildly, based on the actual
pictures being displayed.
Also, it should be noted that if the optional filename is not
supplied, the program will read the picture from stdin.
LIMITATIONS
You'll require (at least) an 8-plane X11 display. This program
ignores 'local colormaps' in GIF files (see the GIF spec for details).
It also only displays the first image in GIF files that have multiple
images in them.
The number of pictures you can display simultaneously varies wildly.
It depends on how many colors are in the GIF files, and how many of
them are shared by other GIF files. Suffice it to say that you can
ALWAYS display a picture, though the colors may or may not be right.
If the program was unable to get all the desired colors, it will
mention that fact.
Note: This program points out a bug in the X11R2 server for the IBM
RT Megapel display. This bug will occasionally cause the colors in a
picture to be wrong, but no 'unable to allocate' message will be
printed by the program. (Essentially, the problem is a discrepancy
between what the server THINKS the colormap is, and what the colormap
in the hardware ACTUALLY is.)
AUTHOR
John Bradley - bradley@cis.upenn.edu
Based (heavily) on gif2ras.c, by Patrick J. Naughton
(naughton@wind.sun.com), a program that converts GIF pictures to Sun
Rasterfiles.
(*) GIF is a no doubt a trademark of CompuServe, so watch it!
- 2 - Formatted: December 14, 2025