'cv2'
import cv2
import os
import glob
path = r'C:\Users\87419\Desktop\cg1\img\*.jpg'
for i in glob.glob(path):
im1 = cv2.imread(i)
im2 = cv2.resize(im1,(256,256))
cv2.imwrite(os.path.join(r'C:\Users\87419\Desktop\cg1\resize',os.path.basename(i)),im2)