@@ -0,0 +1,596 @@
+#!/bin/env python3%0A%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom scipy.ndimage import imread%0A%0Adef rgb2gray(img):%0A%09return np.dot(img, %5B0.299, 0.587, 0.114%5D)%0A%0A%0A%0Aif __name__ == %22__main__%22:%0A%09img_name = %221920x1080.jpg%22%0A%0A%09img = imread(img_name)%0A%0A%09gray_img = rgb2gray(img)%0A%09plt.imshow(gray_img, cmap=plt.cm.gray)%0A%09plt.show()%0A%0A%09resized = np.ndarray((64, 64))%0A%09for (i,j),_ in np.ndenumerate(resized):%0A%09%09f1, f2 = gray_img.shape%5B0%5D // 64, gray_img.shape%5B1%5D // 64%0A%09%09slisse =  gray_img%5Bi*f1:(i+1)*f1,j*f2:(j+1)*f2%5D%0A%09%09resized%5Bi,j%5D = np.max(slisse)%0A%0A%09plt.imshow(resized, cmap=plt.cm.gray)%0A%09plt.show()

Convert an image to grayscale and resize it.