In general, Allegro is designed to be used in only one color depth at a time, so you will call set_color_depth() once and then store all your bitmaps in the same format. If you want to mix several different pixel formats, you can use create_bitmap_ex() in place of create_bitmap(), and call bitmap_color_depth() to query the format of a specific image. Most of the graphics routines require all their input parameters to be in the same format (eg. you cannot stretch a 15 bit source bitmap onto a 24 bit destination), but there are some exceptions: blit() and the rotation routines can copy between bitmaps of any format, converting the data as required, draw_sprite() can draw 256 color source images onto destinations of any format, draw_character_ex() _always_ uses a 256 color source bitmap, whatever the format of the destination, the draw_trans_sprite() and draw_trans_rle_sprite() functions are able to draw 32 bit RGBA images onto any hicolor or truecolor destination, as long as you call set_alpha_blender() first, and the draw_trans_sprite() function is able to draw an 8 bit alpha channel image over the top of an existing 32 bit image, as long as you call set_write_alpha_blender() first.
Expanding a 256 color source onto a truecolor destination is fairly fast (obviously you must set the correct palette before doing this conversion!). Converting between different truecolor formats is slightly slower, and reducing truecolor images to a 256 color destination is very slow (it can be sped up significantly if you set up the global rgb_map table before doing the conversion).
See also: makecol8.
typedef struct { unsigned char data[32][32][32]; } RGB_MAP;
See also: create_rgb_table, makecol8.
See also: rgb_map.