こんにちは、フォルダーから画像を1つずつ開き、画像を処理して他のフォルダーに保存する必要があります。次のサンプルコードを使用してこれを行っています。
path1 = path of folder of images
path2 = path of folder to save images
listing = os.listdir(path1)
for file in listing:
im = Image.open(path1 + file)
im.resize((50,50)) % need to do some more processing here
im.save(path2 + file, "JPEG")
これを行う最善の方法はありますか?
ありがとう!