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
You can use Image.X.decode_truecolor() to convert the raw data to an Image object.
Also, there is Image.X.decode_pseudocolor() which can do the palette lookup for you if you create an Image.Colortable object from the palette data.
It is possible to convert between RGB888 and image object using the "raw" creator method and cast to string.
(string)Image.Image(1,1,"raw","\277\0\0");
(Is the email export working again?)
No, the email export does not work. I'm reading this (rather unpleasantly) through: https://jskom.osd.se/
pike-devel@lists.lysator.liu.se