title: Converting 3x32x32 size numpy image array to 32x32x3 and saving to actual image in Python
body: <p>I have an image in a numpy array of shape (3072,1) or (3,32,32). This consists of first 1024 values corresponds to <strong>Red component</strong> followed by 1024 <strong>Green component</strong> followed by 1024 <strong>Blue component</strong>. These 1024 values corresponds to 32x32 size image. I want to know is there any pythonic way or shortcut to convert this array to 32x32x3 size array so that I can save the array to actual image?</p>
  
  <p>The problem here is if I just <strong>reshape</strong> it with size(32x32x3) by </p>
  
  <pre><code>x = numpy.reshape(x,(32,32,3))
  </code></pre>
  
  <p>then the pixel values will be jumbled up and I won't get the actual image after saving since the original image was of shape (3,32,32)</p>
  
  <p>I just want to save the array into actual image.</p>