title: Best way of saving image file and to save memory
body: <p>In my program i am creating some big pictures (<code>Image</code> objects), and saving them to disk. Then I add them to a list <code>List&lt;Image&gt;</code> but after saving 50 pictures and adding them as <code>Image</code> objects to my <code>imageList</code> it eats up a loooooot of memory. I tried doing this on 50 images and just saving pure image object, my program went up to 160 MB in process manager. So I must find out a way of saving the pictures and adding them to the list without the program eating up all memory.</p>
  
  <p>So I have a couple of solutions and I would love to hear what you think about them or if you have any better ones.</p>
  
  <ol>
  <li>Compress the <code>byte[]</code> array of the image object.</li>
  <li>Compress the stream of the memorysteam object.</li>
  <li>Convert the <code>byte[]</code> array of the image object to string and then compress the string.</li>
  </ol>
  
  <p>I am doing this in c#.</p>