Q:

How to calculate Total value of of an ARGB image?

How can I calculate Total of an Image; the overall total of all elements. 
The source Image is ARGB format, Each color channel can be treated as single 2D matrix. Is this approach right?
Pseudo code:

Total[ImageData[img],2] (*Mathematica code*)

Below is the C# code I have tried; However, I dont understand how to convert the Byte value to Real in C#. Real is Double data type in C#.
// Calculate total of Image; Total[ImageData[img]];
                Rectangle rect = new Rectangle(0, 0, MskImg3G.Width, MskImg3G.Height);
                System.Drawing.Imaging.BitmapData bmpData =
                MskImg3G.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, MskImg3G.PixelFormat);
                IntPtr ptr = bmpData.Scan0;
                int bytes = Math.Abs(bmpData.Stride) * MskImg3G.Height;
                byte[] TotalValues = new byte[bytes];

                // Copy the RGB values into the array.
                System.Runtime.InteropServices.Marshal.Copy(ptr, TotalValues, 0, bytes);

                // do something with the array
                //Console.WriteLine(rgbValues.Length);
                int sum = 0; foreach (byte b in TotalValues) sum += b;
                Console.WriteLine(sum);//Total[ImageData[img, "Byte"], 2]
                double vOut = Convert.ToDouble(sum);//Byte value - original ImageType - Real(MMA type)
                Console.WriteLine(vOut);//Total[ImageData[img, "Byte"], 2]

                // Copy the RGB values back to the bitmap
                System.Runtime.InteropServices.Marshal.Copy(TotalValues, 0, ptr, bytes);
                MskImg3G.UnlockBits(bmpData);
//-------------------------TEST----------------------------------//

Both the console line outputs give: 2774762 is the Byte value, how can I get its Double(real) value? 
> 2774762
> 2774762

How can achieve this in C# ?

A:

Load the image :
Bitmap bitmap = Bitmap.FromFile("C:\\Temp\\img.bmp", true);

Get and process the pixels:
for for (int i=0;i<bitmap .Height;i++) for (int j=0;j<bitmap .width;j++) 
{
  Color c=bitmap .GetPixel(i,j) ;
  // Do your totalisation(s) here using c.R, c.G and c.B
}

