R8bit G8bit B8bit alpha(実質1bit)を R5bit G5bit B5bit alpha1 に変換しています。 8->5bit変換は単純に 8 で割って切り捨てらしい。 ((R>>3)<<10)or((G>>3)<<6)or((B>>3)<<1)+!!alpha