1: public static Bitmap Colorize(Bitmap Image, Color[] Colors)
2: {
3: if (Colors.Length < 256)
4: return null;
5: Bitmap TempBitmap = new Bitmap(Image.Width, Image.Height);
6: for (int x = 0; x < Image.Width; ++x)
7: {
8: for (int y = 0; y < Image.Height; ++y)
9: {
10: int ColorUsing = Image.GetPixel(x, y).R;
11: TempBitmap.SetPixel(x, y, Colors[ColorUsing]);
12: }
13: }
14: return TempBitmap;
15: }