I am trying to read an image from a numpy array using PIL, by doing the following:
from PIL import Image import numpy as np #img is a np array with shape (3,
You don't need to reshape. This is what rollaxis is for:
Image.fromarray(np.rollaxis(img, 0,3))