%$Header: /afs/sipb.mit.edu/project/doc/guide/RCS/graphics.tex,v 1.2 1992/06/27 01:30:38 tlyu Exp $
\section{Graphics}

Athena will soon have an abundance of high-quality graphics workstations
after the summer of 1992, many of them capable of displaying color.  It
is now possible to view or edit bitmaps or other such images rather
easily on Athena workstations.  In addition, it is also possible to use
one of many available images as your background picture.

The X Windows System has a concept of a root window.  This special
window is the ``background'' window for your display.  Normally, this
window displays a boring gray cross-hatch pattern.  Fortunately, by
using some of the programs available in the graphics locker, among other
things.

There are a number of ways that you can change what is in your root
window.  You can use {\it xsetroot\/} to change your background to a
bitmap or some solid color.  For example, you can set your root window
to a solid color by using the {\tt -solid <color>} option to {\it
xsetroot}.  For example, to set your root window to be a solid black,
you can use this command: {\tt xsetroot -solid black}.  You can also set
the root window to a tiled (repeated until it covers the whole window)
bitmap by using the {\tt -bitmap} option to {\it xsetroot}, for example,
{\tt xsetroot -bitmap /mit/sipb/bitmaps.x11/smile}.  For more exciting
things you can do with {\it xsetroot}, you can read the {\it
xsetroot(1)\/} man page.  To learn how to create your own bitmaps, you can
read the {\it bitmap(1)\/} man page.

Note that there are two major formats for black and white images,
namely, ``window dumps'' and ``bitmaps''.  To make matters even
more confusing, ``window dumps'' are often called bitmaps, and graphics
programs might refer to a bitmap window.  Programs usually use one
format or the other, and may have problems if given the wrong one.

\subsection{xpix}

To fill the root window with a real picture, you can use {\it xroot}, in
the {\it xpix\/} locker to display a window dump in root window.
Incidentally, there are other programs in the xpix locker which
manipulate X window dump files.  These window dumps usually have an
extension of ``.dmp''.  To get a listing of the images available in the
{\it xpix\/} locker, you can type the following commands:

\begin{verbatim}
add xpix
ls -C /mit/xpix
\end{verbatim}

(You may want to pipe the list through {\it more}, since there are a
large number of these images in the locker.)  You may notice that almost
all of the images in this locker have the extension ``.dmp.Z''.  The
``.Z'' indicates that the window dump is compressed, and must be
uncompressed before it can be shown.  So, in order to put one of these
pictures in your root window, you need to type something like this:

\begin{verbatim}
zcat /mit/xpix/pictures/stars.dmp.Z | xroot
\end{verbatim}

{\it zcat\/} will uncompress the file, and {\it xroot\/} is what
actually displays the image on the root window.  Also, you can display
window dumps in windows of their own:

\begin{verbatim}
zcat /mit/pictures/stars.dmp.Z | xwud&
\end{verbatim}

The ``\&'' is needed to background the {\it xwud\/} program will not
take over the xterm that you start it up from, and so that you can
continue totype commands into that xterm.

\subsection{gif's, color, and other such fun}

Many other formats for images exist, and many of these support color.
One of the more popular formats is ``gif'', which stands for {\bf
Graphics Interchange Format}.  This format is found in many places, but
the best way to find color images and programs with which to manipulate
them is to look around in the graphics locker.  A quick way to load an
image onto your root window is:

\begin{verbatim}
add graphics
xloadimage -onroot myfile.gif
\end{verbatim}

Once you have added the {\it graphics\/} locker, you can also look at a
number of programs which can do all sorts of things with gif's, as well
as a variety of other graphics formats.  There {\it xv\/} program has a
particularly nice interface, and has the advantage of being able to edit
the colormap of an image.  Many other programs exist in the graphics
locker, some of which can convert one format of graphics file to another.

Although the graphics locker itself does not contain any images, it is
possible to follow the links in the locker to other places that do have
a large number of images.  You can type the following in order to reach
the images:

\begin{verbatim}
/mit/graphics/images/setup-images
\end{verbatim}

This will allow you to look at the images in the various subdirectories
of {\tt /mit/graphics/images}.  You should note that some of the remote
filesystems accessible through this directory are all the way across the
continent, and it may take a while to reach some of them.  In addition,
it is possible that a number of them may be unreachable.
