Answer the question
In order to leave comments, you need to log in
How to convert an image to a 2D python array?
There is this code in python. In the end, it makes a two-dimensional array from the picture, but the problem is that the array is 6x9, and I need 28x28, I will be grateful for any support...
from PIL import Image, ImageGrab
import numpy as np
img = Image.open('image. jpg')
arr = np.asarray(img, dtype='uint8')
print(arr)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question