So I'm working on a program to decode .pic files from old grasp .gl files.  I have code to extract the parts of the .gl file into individual files.  There is a script file, plus a bunch of images, either in .pic or .clp format.  I'm only working on decoding the .pic files.

It supports multiple bit depths, but I'm only doing the vga format, 1 plane with a 768 byte palette (256 each for b, g, r).   I have the code to decode into bgri from the rle encoded file.  I still have to work on converting it either to rgb or rgba, which might just be a simple map.

Anyway, how would I convert this raw pixel data (8 bits for each color) into, say, an Image.Image so I can write as png?  I'm looking at the reference documentation and I don't really see anything for importing raw pixel data.

I might be able to do it using the gtk2 pixmap functions, but I was wondering if it can be done with the pike functions.

Thanks