public static byte[] BitmapToRawIndexed(Bitmap image, BGR565 pal, TileMode tileMode, ColorDepth colorDepth) { if (!_isConvertersInitialized) { InitilizeConverters(); } byte[] alphaValues = null; byte[] uncompressedIndexes; if (tileMode == TileMode.Tiled) { uncompressedIndexes = ImageTypeConverter.GenerateTiledIndices(image, pal, null, false); } else { uncompressedIndexes = ImageTypeConverter.GenerateNotTiledToBmp(image, pal); } byte[] indexes = _indexedFormatConverters[colorDepth].CompressIndexes(uncompressedIndexes); return(indexes); }