[comp.sys.sun] help with rasterfiles

BRVANVOO@MTUS5.BITNET (Brian VanVoorst) (04/13/90)

I have some 8 bit (256 color) sun rasterfiles which I am flipping thru to
make an animation.  These are rather big so the next best idea we have is
to put them into a grayscale, (say 4 or 3 bit) and reducing the memory
needed for each frame, allowing more frames in memory.

Now things get blurry as to what can be done and what can not.  I know
that you can have 8 bit or 1 bit rasterfiles, but I have not found any
proof that you can have something between.  If you can, I don't know that
it saves me any space (perhaps it stores a 4 bit image in the space of a 8
bit image).  Does anyone know the facts?

Next is the software required to do this.... I got the Fuzzy Bit Map tools
and tried playing with those a little.  I wasn't very successful in
accomplishing much of anything.  If my goal is to turn a 256 color sun
rasterfile into a 8 color gray-color rasterfile, can I do this with FBM?
Does anyone have any suggestion as to what series of commands to issue?

(note: clr2gray produces 256 color grayscale images, which I could combine
with fbquant to make into 8 color (gray?) images, if I can first turn it
into a 24bit image.... (sigh))

One other hope.... is there a program already out there to do what I need?

Thank you for your help!
All ideas are welcome!
Please respond!

Brian VanVoorst
brvanvoo at MTUS5.bitnet

wsd@cs.brown.edu (Wm. Scott `Spot' Draves) (04/13/90)

You can't have pixrects with arbitrary numbers of bits per pixel, but you
can do what you want by using the clut.

Say you wanted 4bits per pixel.  Combine every pair of 8 bit images into a
new 8 bit image with the bits split 4 and 4 (say put the first image in
the low 4 bits).  save both 16 entry luts (you can save them in the first
32 entries of the lut that is stored with the image; this would look awful
if the image were actually viewed with it).  Then, when it comes time to
display the images, load the 8 bit combined image.  Then load the clut to
ignore the high bits.  Wait 1/30th of a second (or whatever).  then reload
the lut to ignore the low bits.  Then go on to the next image.  It is best
to the images/clut during vertical retrace.

This might block till a vertical retrace:
    ioctl(screen->fd, FBIOVERTICAL, 0);  /* Ack! syscalls! */

Scott Draves			Space... The Final Frontier
wsd@cs.brown.edu
uunet!brunix!wsd
Box 2555 Brown U Prov RI 02912