title: Most efficient method for reading/writing image files as numpy array
body: <p>I am wondering what the most efficient methods for reading/writing image and PDF files as numpy arrays for processing.</p>
  
  <p>So far I have seen <code>scipy.ndimage.imread</code> and using <code>PIL</code> and numpy,  which yeild the following results:</p>
  
  <pre><code>import os
  import glob
  from scipy.ndimage import imread
  from PIL import Image
  import numpy as np
  import timeit
  iters = 2
  def scipy_fun():
      for x in glob.glob("*.jpg"):
          px = imread(x)
  def PIL_fun():
      for x in glob.glob("*.jpg"):
          with Image.open(x) as im:
              px = np.array(im)
  
  print(timeit.Timer(scipy_fun).timeit(number=iters))
  print(timeit.Timer(PIL_fun).timeit(number=iters))
  </code></pre>
  
  <p>running the script shows similar results with marginally better from scipy:</p>
  
  <pre><code>2.8794324089019234
  3.0174482765699095
  </code></pre>
  
  <p>Are there any faster ways to do this?</p>