title: Background color when cropping image with PIL
body: <p>The good thing with <a href="https://pillow.readthedocs.io/en/3.1.x/reference/Image.html#PIL.Image.Image.crop" rel="noreferrer"><code>PIL.crop</code></a> is that if we want to crop outside of the image dimensions, it simply works with:</p>
  
  <pre><code>from PIL import Image
  img = Image.open("test.jpg")
  img.crop((-10, -20, 1000, 500)).save("output.jpg")
  </code></pre>
  
  <p><strong>Question: how to change the background color of the added region to white (default: black)?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/awHzE.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/awHzE.jpg" alt="enter image description here"></a></p>
  
  <p>Note: </p>
  
  <ul>
  <li><p>if possible, I'd like to keep <code>crop</code>, and avoid to have to create a new image and paste the cropped image there like in <a href="https://stackoverflow.com/questions/12177972/crop-image-change-black-area-if-not-not-enough-photo-region-in-white">Crop image, change black area if not not enough photo region in white</a>.</p></li>
  <li><p>Here is a download link to original image: <a href="https://i.stack.imgur.com/gtA70.jpg" rel="noreferrer">https://i.stack.imgur.com/gtA70.jpg</a> (303x341 pixels)</p></li>
  </ul>