transform bmp to char