title: How to save a jpegtran JPEG in a numpy same as with PIL?
body: <p>I have started using a new library in my Python program to process images due to speed. I was using PIL but now I am using jpegtran. My previous code I would save the image to a numpy array and that worked perfectly fine, but now since the datatype is different I am having problems creating the same numpy array.</p>
  
  <p>PIL code:</p>
  
  <pre><code> In[1]: import numpy
   In[2]: from PIL import Image
   In[3]: image = Image.open('43.jpg')
   In[4]: image
  Out[4]: &lt;PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=3216x2136 at 0x7F34CC1876C8&gt;
   In[5]: imgArray2 = numpy.asarray(image, dtype=numpy.float32)
   In[6]: imgArray2.shape
  Out[6]: (2136, 3216, 3)
  </code></pre>
  
  <p>jpegtran code: </p>
  
  <pre><code> In[1]: import numpy
   In[2]: from jpegtran import JPEGImage
   In[3]: imgTran = JPEGImage('43.jpg')
   In[4]: imgTran
  Out[4]: &lt;jpegtran.transform.JPEGImage at 0x7f34d58a9910&gt;
   In[5]: imgArray = numpy.asarray(imgTran.data, dtype=numpy.float32)
   In[6]: imgArray.shape
  Out[6]: (777062,)
  </code></pre>
  
  <p>I need the original shape (2136, 3216, 3) for it to work with the rest of my code.</p>