title: How to load images larger than MAX_IMAGE_PIXELS with PIL?
body: <p>I'm trying to load some images into my Jupiter Notebook but PIL.Image.open() says that the image is too large. The MAX_IMAGE_PIXEL is set in the PIL Image source code but my image is much larger. I'm wondering if there's a way around this?</p>
  
  <p>The code below works for smaller images. I've looked into trying to manually set the MAX_IMAGE_PIXEL but can't seem to do so. </p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import matplotlib.pyplot as plt
  from PIL import Image
  
  im = np.array(Image.open('data/big_image.jpg'), dtype=np.uint8)
  
  # Create figure and axes
  fig,ax = plt.subplots(1,figsize=(10,10))
  
  # Display the image
  ax.imshow(im)
  
  plt.show()
  </code></pre>
  
  <p>The code above returns the following error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  DecompressionBombError                    Traceback (most recent call last)
  &lt;ipython-input-15-09854c1c6343&gt; in &lt;module&gt;
        3 from PIL import Image
        4 
  ----&gt; 5 im = np.array(Image.open('data/big_image.jpg'), dtype=np.uint8)
        6 
        7 # Create figure and axes
  
  /opt/anaconda3/lib/python3.7/site-packages/PIL/Image.py in open(fp, mode)
     2640         return None
     2641 
  -&gt; 2642     im = _open_core(fp, filename, prefix)
     2643 
     2644     if im is None:
  
  /opt/anaconda3/lib/python3.7/site-packages/PIL/Image.py in _open_core(fp, filename, prefix)
     2631                     fp.seek(0)
     2632                     im = factory(fp, filename)
  -&gt; 2633                     _decompression_bomb_check(im.size)
     2634                     return im
     2635             except (SyntaxError, IndexError, TypeError, struct.error):
  
  /opt/anaconda3/lib/python3.7/site-packages/PIL/Image.py in _decompression_bomb_check(size)
     2566             "Image size (%d pixels) exceeds limit of %d pixels, "
     2567             "could be decompression bomb DOS attack." %
  -&gt; 2568             (pixels, 2 * MAX_IMAGE_PIXELS))
     2569 
     2570     if pixels &gt; MAX_IMAGE_PIXELS:
  
  DecompressionBombError: Image size (1435500544 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
  </code></pre>
  
  <p>Any help is appreciated!</p>