[comp.sys.mac.programmer] Creating 24-bit PICTs on 8-bit Macs

su0z+@andrew.cmu.edu (Sherman Uitzetter) (01/29/91)

    I've written a program that generates an image that has 24-bits per
pixel color information.  That is, for every pixel in the image that my
program generates I have 8 bits of red, green, and blue.  I would like
to save the generated image as a PICT file without losing in color
information.
    If I had a 24-bit color board in my mac I could just create on
offscreen, 24-bit, PixMap and do a CopyBits() when saving the PICT.  I
don't have a 24-bit color board and I don't want to get one.
    What I've managed to do is create a PICT file that is a (large)
sequence of SetCPixel() operations (yuck!).  I've, then, been able to
take these PICT files to a friend's Mac that does have 24-bit color and
open the PICTs with PixelPaint (not a speedy operation).  Once the PICT
is opened in PixelPaint saving it again creates a nice compact PICT file
(of the form I want to generate directly).  [These 24-bit PICTs are
dithered nicely when brought back to my 8-bit Mac (this may only be with
32-bit QD).]
   Anyway, has anybody done anything like this; create 24-bit PICTs on
machines with less than 24-bits per pixel color info?  I think I need to
do something like create a 24-bit graphics device and then make an
offscreen PixMap using a CGrafPort created with that graphics device. 
Well, whatever, any poke in the right direction would be greatly
appreciated.


-Sherman.