Looking at the XPM (X PixMap) image format, I don't see anywhere that the number of bits per channel (or, equivalently, the number of possible colors) is specified. Poking around on my Ubuntu system, I see a number of examples of XPM files, and most of them have 8 bits per channel (24 bits for R, G, B), but some have 16 bits per color (48 bits for R, G, B).
For example, here's the first part of teapot.xpm
which is packaged with the XFig application:
/* XPM */
static char * teapot_xpm[] = {
"234 149 34 1",
" c #FFFFFFFFFFFF",
". c #FFFF9191AAAA",
"X c #DADA9191AAAA",
"o c #FFFFB6B6AAAA",
"O c #FFFFB6B6FFFF",
etc.
Is there a way to determine the number of bits per channel, aside from inspecting the hexadecimal numbers and counting how many characters they occupy?