In this tutorial, I'll show you how to convert an image to byte array in C#.Net

You can use the MemoryStream to copy data from the Image, then convert to byte array

public byte[] ImageToByteArray(System.Drawing.Image image)
{
   using (MemoryStream ms = new MemoryStream())
   {
      image.Save(ms,image.RawFormat);//Image format JPG, PNG...etc
      return  ms.ToArray();
   }
}

Or you can use the ImageConverter to convert a image to byte array

public static byte[] ConverterImageToByteArray(Image img)
{
    ImageConverter image = new ImageConverter();
    byte[] data = (byte[])image.ConvertTo(img, typeof(byte[]));
    return data;
}

Another way to convert byte array from image

string path = @"C:\Images\csharpcode.jpg"
byte[] images = System.IO.File.ReadAllBytes(HttpContext.Current.Server.MapPath(path));

I hope so you can find the best solution to convert an image to byte array