I'm trying to mimic what this line of code does, using imageio
:
img_array = scipy.misc.imread('/Users/user/Desktop/IMG_5.png', flatten=True)
img_data = 255.0 - img_array.reshape(784)`
However when using imageio
I get:
img = imageio.imread('/Users/user/Desktop/IMG_5.png')
img.flatten()
Output: Image([212, 211, 209, ..., 192, 190, 191], dtype=uint8)
img.reshape(1, 784)
ValueError: cannot reshape array of size 2352 into shape (1,784)
Can someone explain what is going on here, why is my image size 2352? I resized the image to 28x28 pixels before importing it.