from PIL import Image
import os

IMG_DIR = 'C:/Users/soyeon/Desktop/fishdata/'

for img in os.listdir(IMG_DIR):
    image = Image.open(os.path.join(IMG_DIR,img))
    # resize 할 이미지 사이즈 
    resize_image = image.resize((240, 240))
    # 저장할 파일 Type : JPEG, PNG 등 
    # 저장할 때 Quality 수준 : 보통 95 사용 
    resize_image.save(os.path.join(IMG_DIR,img), "JPEG", quality=95 )

7d51373e797aa9a1dcd6e838567576473b390228
<mask token>

<mask token>
for img in os.listdir(IMG_DIR):
    image = Image.open(os.path.join(IMG_DIR, img))
    resize_image = image.resize((240, 240))
    resize_image.save(os.path.join(IMG_DIR, img), 'JPEG', quality=95)

<mask token>
IMG_DIR = 'C:/Users/soyeon/Desktop/fishdata/'
for img in os.listdir(IMG_DIR):
    image = Image.open(os.path.join(IMG_DIR, img))
    resize_image = image.resize((240, 240))
    resize_image.save(os.path.join(IMG_DIR, img), 'JPEG', quality=95)

from PIL import Image
import os
IMG_DIR = 'C:/Users/soyeon/Desktop/fishdata/'
for img in os.listdir(IMG_DIR):
    image = Image.open(os.path.join(IMG_DIR, img))
    resize_image = image.resize((240, 240))
    resize_image.save(os.path.join(IMG_DIR, img), 'JPEG', quality=95)

from PIL import Image
import os

IMG_DIR = 'C:/Users/soyeon/Desktop/fishdata/'

for img in os.listdir(IMG_DIR):
    image = Image.open(os.path.join(IMG_DIR,img))
    # resize 할 이미지 사이즈 
    resize_image = image.resize((240, 240))
    # 저장할 파일 Type : JPEG, PNG 등 
    # 저장할 때 Quality 수준 : 보통 95 사용 
    resize_image.save(os.path.join(IMG_DIR,img), "JPEG", quality=95 )
