python版本图片下采样


# file_list = os.listdir(path)
#
# for  i in range(len(file_list)):
#     print(file_list[i])
#     name = file_list[i].split('.')[-2]
#     path_hr = path+'/'+file_list[i]
#     img_hr = Image.open(path_hr)
#     img_ref = img_hr.resize(
#             (x // 4 for x in img_hr.size), Image.BICUBIC)
#     path_ref = './..'+name+'_ref'+'.png'
#     img_ref.save(path_ref)

 

posted on 2021-05-15 15:36  cltt  阅读(554)  评论(0编辑  收藏  举报

导航