public static byte[] Histogram(Bitmap bitmap) { byte[] histogram = new byte[bitmap.Width * bitmap.Height * 3]; Color color; int e = 0; for (int i = 0; i < bitmap.Width; i++) { for (int j = 0; j < bitmap.Height; j++) { color = bitmap.GetPixel(i, j); histogram[e] = color.R; histogram[e + 1] = color.B; histogram[e + 2] = color.G; e += 3; } } return(Darwin.ToArray(bitmap)); }