import numpy as np from PIL import Image path = 'res/input.tga' img = Image.open(path) data = np.asarray(img.convert('L')) # -- this will print the resolution of the image in pixels, as numpy converts our image to an # -- array with dimensions equal to the number of pixels in width / height of the image. print(data.shape)