Skip to content
Snippets Groups Projects
Commit 432a8330 authored by Shifa Chang's avatar Shifa Chang Committed by hoijui
Browse files

added resize pictures code

parent d239aadb
No related branches found
No related tags found
No related merge requests found
from PIL import Image
import os
import sys
import cv2
from datetime import datetime
for image_file_name in os.listdir('D:\\Users\\DELL\\frame\\'):
if image_file_name.endswith(".png"):
now = datetime.now().strftime('%Y%m%d-%H%M%S-%f')
im = Image.open('C:\\Users\\DELL\\Documents\\frame\\'+image_file_name)
new_width = 150
new_height = 150
im = im.resize((new_width, new_height), Image.ANTIALIAS)
new_path = 'D:\\Users\\DELL\\frame\\resized_frames\\'
im.save(new_path + now + '.png')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment