I added a function to Allegro SVN today called al_create_user_bitmap(). It allows you to load custom texture format images (only tested with OpenGL) like say PVR or ETC1, but in my case I'm using it to load 8 bit paletted images on Android (should work on iOS too) with the OES_compressed_paletted_texture extension (which Allegro loads itself.)
The images save some memory (though that can depend on the device/drivers as some may just convert to a 32 bit image internally.) The code is C++ but the interface can be used from C. Loading a paletted image is a little bit round-about because you have to have created or loaded the image you want to convert to paletted beforehand, but it doesn't seem to slow my game down during loading much.
This is basically all there is to it:
w = al_get_bitmap_width(
h = al_get_bitmap_height(
sz = (256*4) + (
6unsigned char *
imgdata = new unsigned char[
exact = new uint16_t;
bitmap, imgdata, exact);
w, h, upload_paletted_image, &
16/* Could now delete bitmap as 'pal' is an 8 bit copy */
Make a function with that and you can load, then convert to 8 bit. I don't know if and how palette effects are possible with this. I don't know if you can modify the palette. I didn't make it for that purpose but it would be neat if you can. The code is attached, may require a tiny bit of work to get compiled and working as I ripped it from my game and removed anything specific to my game from it.
NOTE: You can lock these images READONLY but not for writing.
NOTE2: I haven't tried this with ANY images with a lot of colors. For all I know, and it's highly probably that I've only used images with < 256 colors, so the quantization isn't tested. I based it off reading the description of how the Allegro 4 quantization works from the source code (I was going to copy the code but it seemed like it'd be simpler to do it myself.)
EDIT: I've been working on it, since I tested with higher color images and it didn't work. It works pretty good now and is a lot faster. Still not super fast, but on my fairly slow tablet it takes 0.87 seconds to convert the 800x600 image below. The results aren't bad.
The bright light in the window is the worst part. If anyone wants me to post the new source I will.