\section{Xpix}

The X Window System contains the concept of a {\em root window}; it is
what you probably think of as the ``background.''  By default, when
the X server starts up it fills in the root window with a grey
cross-hatch pattern.  It is possible to change the contents of the
root window.  There are two programs that you are likely to use to do
this, xsetroot and xroot.

Xsetroot can be used to set the root background to a solid color or a
bitmap.  To set a solid color, use the option \verb+-solid <color>+,
for example, \verb+xsetroot -solid black+.  Use the \verb+-bitmap+
option to put a bitmap into the root window; for example,
\verb+xsetroot -bitmap /mit/sipb/bitmaps.x11/smile+.  The bitmap is
repeated as many times as is necessary to fill the root window.  (For
information on creating your own bitmaps, read the bitmap(1) man
page.)  Actually, xsetroot can do other things as well; read the
xsetroot(1) man page for more information.

Note there are two different formats in common use, ``bitmap'' and
``window dump''. To make things even more confusing, ``window dump''
files are often called bitmaps, and graphics programs might refer to
a bitmap window. Programs usually expect either one format or the
other, and will become very confused if given the wrong one.

It is also possible to fill the root window with a real picture.  To
do this, you must have what is called an X window dump file.  There
are many of these available online, some in the {\tt xpix} locker
(this, not coincidentally, is one place where programs that use window
dump files are stored).  For a listing of all the images available in
this locker, type the following commands:

\begin{verbatim}
attach xpix
ls -C /mit/xpix/pictures | more
\end{verbatim}

(You want to pipe the list through ``more'' because there are more
pictures than can be listed on one screen. The -C option saves space by
forcing the listing to have many columns.)  You may notice that all of
the files in that directory have the extension ``.dmp.Z''. The ``.Z''
means that the file has been {\em compressed}, because these files 
are large and uncompressed they take up too much disk space.  The .dmp
is one of the extensions used to indicate that the file is an X window
dump (other common ones are .x11 and .xwd).  Thus, to put a picture in
your root window, you must first uncompress it and then send the file to
the program named ``xroot.''  Here is a sample command to do this:

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

Zcat uncompresses the file and sends it to standard output; xroot
then reads the uncompressed file from standard input and displays it
on the screen.  You should replace ``vaxbin'' with ``rtbin'' if you
are using an IBM RT workstation (there is also a version available
for the DECstation 3100, in decmipsbin.). In the following
instructions, if the only difference between the versions of the
command is in which ``bin'' to use, only the ``vaxbin'' version will be
displayed.

Once you've seen some nice pictures, you may want to make printouts of
them. The command for this is:

\begin{verbatim}
zcat /mit/xpix/pictures/stars.dmp.Z | xpr -rv | lpr -P<name of printer>
\end{verbatim}

The program \verb+xpr+ prints X window dumps. The use of \verb+-rv+ is
necessary because of differences between the way screens and printers
deal with images. If the picture comes out looking like a photographic
negative, or you like inverse-video special effects, omit the \verb+-rv+
option.

You can also display the pictures in windows of their own:

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

This creates a window, no different from any other one, devoted
entirely to the image. The ``\&'' is needed so that you can type other
commands while the window exists.

The selection of images available in the xpix locker is subject to heavy
censorship. More extensive collections exist in various places. Ask
around. 

\subsection{Color xpix}

Project Athena possesses a few workstations that support color.  Most
of those open to public use can be found in room 11-113 (The
Fishbowl).

There are two types of color workstations: DEC and IBM. The DEC
workstations have Parallax video boards, while the IBM ones usually
have MegaPel graphics boards\footnote{There exist IBM workstations
with Parallax boards, but we won't talk about them\ldots}. The most
important piece of information to remember about these is that you can
watch TV on workstations equipped with Parallax boards.

When these color workstations deactivate, they run an idle display
that shows various color pictures. The pictures change every five
minutes. The images are shown by programming the graphics boards
directly, entirely bypassing X.

People often want to display these color pictures on their X screens
or use them as backgrounds. While not entirely impossible, attempting
to do this will run you into so many unimplemented features, X
problems, and outright bugs that it is not for the faint of heart (or
weak of programming). Many of the relevant programs can be found in
the {\tt pictures} filesystem. The picture files themselves are in
{\it /mit/pictures/display}.

While the images are stored in color X window dump format
(compressed), using any standard X programs (xwd, xwud, xpr, etc.)
will probably fail. This is due to the fact that color is supported
poorly, if at all, in these programs. In particular, attempting to
undump a color file, if a window is created at all, usually results
in a window with colors unrelated to those in the image. In the worst
case, the workstation will crash. If the preceding warnings haven't
dissuaded you, you could try:

\begin{verbatim}
zcat /mit/pictures/display/filename.x11.Z | /mit/pictures/vaxbin/plxwud
\end{verbatim}

\begin{verbatim}
zcat /mit/pictures/display/filename.x11.Z | /mit/pictures/rtbin/mpel_display
\end{verbatim}

The author of these programs cautions that anyone who does this
(particularly the second) is living dangerously, and disclaims all
responsibility for any resulting consequences.

Color X images can be displayed on monochrome screens, although a
great deal is lost in translation. Use:

\begin{verbatim}
zcat /mit/pictures/display/filename.x11.Z |/mit/pictures/vaxbin/xmono | xwud &
\end{verbatim}

Nobody has put in the effort to get color backgrounds to work
properly. Currently, using xroot (as described above) might produce a
background with the wrong colors. The most probable result is an X
error.

Other interesting color X programs can be found in the {\tt video} and
{\tt visual} filesystems.

As mentioned earlier, it's possible to watch television on some of the
color workstations. There's a video instructions document which
describes how to do this. The TV window looks like a typical color
window, but looks are deceptive. There is no easy way to save and
redisplay the color image (this has frustrated many people).  Using
the standard X window dumping program (xwd) will produce nothing
readily usable. The color format is not anything you want to deal with
\footnote{It's 15 or 18 bits of YUV information, if you must know.}.

There is a public mailing list for discussing xpix and graphics
topics.  It's called, appropriately enough, ``xpix.''  See the section
on ``Moira'' for instructions if you wish to add yourself to the list.
