python版本图片下采样

Posted cltt

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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)

 

以上是关于python版本图片下采样的主要内容,如果未能解决你的问题,请参考以下文章