title: Trying to change image DPI without changing file size
body: <p>I have the following code for changing the DPI of an image:</p>
  
  <pre><code>public void changeDPI(string imagePathSource,string imagePathDestination,float DPIx,float DPIy)
          {
              Bitmap bitmap = new Bitmap(imagePathSource);
              Bitmap newBitmap = new Bitmap(bitmap);
              newBitmap.SetResolution(DPIx,DPIy);
              newBitmap.Save(imagePathDestination);
          }
  </code></pre>
  
  <p>However, this ends up changing the memory size of the file.  An example test image started at 267 KB, and the <code>newBitmap</code> version of the file ended up as 1.51 MB.  How can I change the DPI without changing the file size?</p>