title: Image compression in ASP.NET MVC
body: <p>I have a lot of images(about 1,000) in 30kb aproximately, the load size of the index was 45.5mb, if you ask why.</p>
  
  <p>i get the images from a server, then convert to byte array and then to base64 string to send to index in </p>
  
  <pre><code>data:image/webp;base64,{0}
  </code></pre>
  
  <p>i use this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>Html.Raw(String.Format("data:image/webp;base64,{0}", Convert.ToBase64String(File.ReadAllBytes("\\\\ImageServer\\ImagePathFolder\\Image.JPG".Replace("\\", "\\\\")))))
  </code></pre>
  
  <p>so far the index takes to load about 24 seconds.</p>
  
  <p>I ask for help to compress the images and get at least the half size now i get.</p>
  
  <blockquote>
    <p>NOTE: all this code in in ASP.NET MVC with C#</p>
  </blockquote>