title: How does Python PIL and PILLOW compress pictures?
body: <p>I wanted to write a program with Python 3.3 in which a frame is added to a picture.
  I use the PIL package from Python to do that. But the pictures I get are less than a third as big as the original and they loose quite some focus/sharpness/gloss. Where does Python compress/change the picture and how (if possible) can I subdue it?</p>
  
  <p>I could think of some passages, which might be the one compressing.</p>
  
  <ol>
  <li><p>I load the image with PIL:</p>
  
  <p><code>img = Image.open(element)</code></p></li>
  <li><p>I create a new picture, which is black:</p>
  
  <p><code>newImg = Image.new("RGB",(imgWidthNew,imgHightNew),(0,0,0,0))</code></p></li>
  <li><p>I create a pixel map out of my picture and change some:</p>
  
  <p><code>pixels = newImg.load()</code></p></li>
  <li><p>I paste my picture into the middle of the black one:</p>
  
  <p><code>newImg.paste (Image.open(element), (halfFrameWidth, halfFrameHight, imgWidth+halfFrameWidth, imgHight+halfFrameHight))</code></p></li>
  <li><p>The new image is beeing saved:</p>
  
  <p><code>newImg.save(path,dpi=[300,300])</code></p></li>
  </ol>
  
  <p>I load mostly .jpg pictures, but due to some problems I extract .bmp files.</p>
  
  <pre><code> path = path[:path.rfind(".")] + fileEnding
  </code></pre>
  
  <p>But this shouldnt be the problem, because I have the same issues without changing the data type.
  My operating system is Windows7 64BIT and I use Pillow 2.3.0 with Python 3.3.</p>
  
  <p>Thank you for any help.</p>