1from PIL import Image
2
3newImg1 = Image.new('RGB', (512,512))
4newImg1.save("img1.png")
1import os
2from PIL import Image
3
4PATH = "F:\\FYP DATASET\\images\\outliers Dataset\\Not Outliers\\"
5Copy_to_path="F:\\FYP DATASET\\images\\outliers Dataset\\"
6
7for filename in os.listdir(PATH):
8 img = Image.open(os.path.join(PATH, filename)) # images are color images
9 img = img.resize((224,224), Image.ANTIALIAS)
10 img.save(Copy_to_path+filename+'.jpeg')
11