title: I want to convert 32*32*3 rgb image to gray scale with 32*32*1 dimension using Python
body: <p>The following is my function to convert RGB to gray scale image.</p>
  
  <p>My input image is <code>32*32*3</code> where as the output dimension looks like <code>32*32</code>, But i am looking for <code>32*32*1</code>.  Do I need to resize or re scale this image. </p>
  
  <p>Any thoughts?</p>
  
  <pre><code>def rgb2gray(rgb):
      return np.dot(rgb[...,:3], [0.299, 0.587, 0.114])
  </code></pre>