[comp.windows.x] color bitmap files

billd@celerity.uucp (Bill Davidson) (06/05/89)

First I'd like to thank all the people who sent me info about
X Terminals.  Many people sent me things.  My mailbox runneth
over.  I can probably send the stuff to a few people who ask
for it but if I get over about 20 queries I won't do it anymore
(maybe I'll post it but Paul Anderson already seems to be doing
that occasionally).

Anyway, those of you who also read comp.graphics may know that
I've been involved in a discussion about color quantization.
So far, my quantizer only puts out sun rasterfiles.  I'd like
to change to X as my working environment soon.  I wanted to
make X bitmap files with 8-bit color for the 3/60C we have here
but I can't seem to find anything for color bitmaps.  The 2-color
bitmap files are straightforward.  They're even easy to write
without the X library functions.  I found XWDFile.h and xwd.
That's a program and not a library function (I think ???).
Is there a way to store and retrieve arbitrary color bitmaps
in files? I would think that I just can't find it in the books
that I have.  (Dare I say it: "It must be there" :-).  Since
the whole point of having a "smart" quantizer is to choose the
best possible colormap for the image, I need to be able to store
the colormap in the file and have the display program try to
set the colormap to the one specified in the file (and, of
course, restore it after it's done).

	--Bill (wannabegraphicsguru) Davidson
Bill Davidson		...!{ucsd,sdsu,fpssun,cogen,chip,photon}!celerity!billd

robertw@hpcvlx.HP.COM (Robert B. Williams) (06/07/89)

As usual our dumb mailer can't find your address:

  >without the X library functions.  I found XWDFile.h and xwd.
  >That's a program and not a library function (I think ???).
Right, xwd is a client. It has a companion client xwud which will
undump the file xwd writes.  The R3 version (from HP anyway) will convert the
colors it finds in the included colormap (see XWDFile.h) to a set of
colors in a colormap matching the target visual.
  >Is there a way to store and retrieve arbitrary color bitmaps
  >in files? 
No such thing as a color bitmap.  If its more than just on or off its a
pixmap.  They aren't the same, and the xlib tools for handling them
aren't the same.  (See Pgming Xlib 6.7)
  >the colormap in the file and have the display program try to
  >set the colormap to the one specified in the file (and, of
  >course, restore it after it's done).
Exactly what xwud does.  Of course its the window manager that actually
installs the colormap, but xwud defines one from the data in the file.

	  >--Bill (wannabegraphicsguru) Davidson

 Robert Williams robertw@hp-pcd.HP.COM
503-750-2818, Corvallis Workstation Operation