title: Numpy where not giving expected shape
body: <p>The problem is fairly simple.  Given a 256x256 grayscale image, I want to return a color image with colors based on a threshold.</p>
  
  <p>So I'm thinking:</p>
  
  <pre><code>img=whatever # 2D array of floats representing grayscale image
  threshold=0.5
  color1=[1.0,0.0,0.0]
  color2=[0.0,0.0,1.0]
  newImg=np.where(img&gt;threshold,color1,color2)
  </code></pre>
  
  <p>Yet I get the infamous:
  "ValueError: operands could not be broadcast together with shapes (500,500) (3,) (3,)"</p>
  
  <p>Huh?  I was really expecting that to give an array shaped (500,500,3). Why didn't it combine them??</p>