Cannot downgrrade image using reshape function

i am trying to reshape an image of size (100,100,3) to (40,40,3) and its giving me the error “cannot reshape array of size 30000 into shape (40,40,3)”. In the video Pokemon Classification and Overfitting in neural networks, prateek bhaiya’s command worked fine but i am not able to reshape. I searched google and found that we cannot reduce the elements in image matrix. Help me

Hi Pranshu,
You cannot downgrade an array like that.
The reshape function just helps us to change the shape of a particular and not crop it. What reshaping means is that we redistribute some rows (H), columns (W) and channels (CH) in such a way that the value of H.W.CH remains the same.

What Bhaiya did in the video was not reshaping, he defined the target size while reading the image from the path itself, that is defining the original image size which we are reading it as.

I hope this clarifies your doubt.