title: Fast TIFF image conversion to show in web-client
body: <p>For preview of scanned TIFF-document currently I use the following:</p>
  
  <pre><code>Bitmap bmp = new Bitmap(@"document.tif");
  var ms = new MemoryStream();
  
  bmp.Save(ms, ImageFormat.Png);
  
  var bmpBytes = ms.GetBuffer();
  bmp.Dispose();
  ms.Close();
  
  return new FileStreamResult(new MemoryStream(bmpBytes), "image/png");
  </code></pre>
  
  <p>Is there any way to speed up the conversion? Using something else than standard Image.Save() method?</p>
  
  <p>I've found unsafe class which locks and unlocks bitmapData between pixel manipulation <a href="http://www.vcskicks.com/fast-image-processing.php" rel="nofollow">here</a>, but I'm not sure that it's suitable for my task (because I need only to transform from one format to another). However my profiler shows about 30ms win (before 116 ms, after 83 ms)</p>