Why jpeg image becomes 2D array after being loaded
<p>I have a jpeg image as follows:</p>

<p><a href="http://i.stack.imgur.com/b0Dma.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/b0Dma.jpg" alt="enter image description here"></a>
<br>Now I want to load this image to do image processing. I use the following code:</p>

<pre><code>from scipy import misc
import numpy as np
im = misc.imread('logo.jpg')
</code></pre>

<p>Because the image is a coloured one, I would expect <code>im</code> is a 3D matrix. However, <code>im.shape</code> gives me a 2D matrix:
<code>(150, 150)</code></p>

<p>I tried another way of loading image as follows:</p>

<pre><code>from PIL import Image
jpgfile = Image.open("logo.jpg")
</code></pre>

<p>But <code>jpgfile</code> also has the size of <code>150x150</code>. 
My question is: What's wrong with my code, or my understanding about RGB image is wrong?
Thank you very much.</p>

<p>From the docs here: <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imread.html" rel="nofollow">http://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imread.html</a>, specify <code>mode='RGB'</code> to get the red, green, blue values. The output appears to default to conversion to a grayscale number.</p>

python image image-processing