title: Out Of Memory Exception when working with large images
body: <p>The following line throws an OutOfMemoryException when loading a large image</p>
  
  <pre><code>System.Drawing.Image img = System.Drawing.Image.FromFile(filepath);
  </code></pre>
  
  <p>I tried with a 8280x6208 8,76 MB image file and lots of other smaller images, that works fine. </p>
  
  <p>But when I try with a 10328x7760 6,44 MB image file, it throws the OutOfMemoryException. </p>
  
  <p>I also tried opening the file in photoshop and save it with worse quality (1,32 MB), but with the same dimensions, it throws the OutOfMemoryException.</p>
  
  <p>I tried upscaling another smaller image to 10328x7760 and that throws the OutOfMemoryException too.</p>
  
  <p>So I'm pretty sure it's an actual out of memory problem and my question is: </p>
  
  <p>Can I increase the memory somehow? </p>
  
  <p>I'm using Windows 8.1 64 bit with 8GB RAM, Visual Studio 2013 with IIS Express. It's a Web Application project.</p>
  
  <p>EDIT: I don't think it's a format issue as suggested, I tried with a 10000x10000 black image and a 5000x5000 black image. The 10000 throws OOM, the 5000 don't.</p>