The following color table can be used to convert a RGB image to an IndexColorModel image with 16 colors. Does anyone know how to create the color tables of 32, 64, 128 ,256 colors for IndexcolorModel image. ?
int[] cmap = { 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, //8 primary colors
0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff, // …
0xff1c1c1c, 0xff383838, 0xff555555, 0xff717171, //8 shades of gray
0xff8e8e8e, 0xffaaaaaa, 0xffc7c7c7, 0xffe3e3e3 };
Jay