Storing an image dataset into 4D array then showing each image leads to distorted colors

Viewed 490

I am trying to store an image dataset into a 4D ndarray then plot each image as follows:

i=0
for j in imagelist:
  imageall[i] = misc.imread(j) ##(36, 570, 760, 3)
  plt.imshow(imageall[i])
  plt.show()
  i=i+1

However, showing the image from the 4D ndarray gives a bluish image whereas simply reading the image and plotting it shows the image in its normal coloring.

I have compared channels (visually and by computing means in the 2 cases and they are exactly the same).

Can anyone explain the reason for change in displayed image coloration when reading single image and when reading to a 4D ndarray?

Result from showing single image

Result from showing the same image but from the 4D ndarray

1 Answers
Related