Indexed images

BlitzMax Forums/BlitzMax Programming/Indexed images

No you'd read the pixels into a pixmap. You'd have to, as you say, store them as colors rather than as indexes to colors. You'd be converting from an indirect index for each pixel, to a direct copy of the color value for each pixel.

You could draw the pixels straight to the backbuffer if you prefer and then grab to an image or a pixmap.

There's not any inbuilt stuff in Max to handle a 256-color image or to treat it as such using a palette. Ie changing the palette doesn't change the image. But if you did want that to happen, what you'd basically have to do is think of the palette as a table of values to REMAP the image to. Each time you change a color in the palette, go through all pixels in the image and if the pixel has that index, change it to the new color. But you'll have to then keep a copy of the indexed image as well as the 32-bit image.