博客
关于我
python代码——批量生成灰度图片
阅读量:688 次
发布时间:2019-03-17

本文共 518 字,大约阅读时间需要 1 分钟。

from PIL import Imageimport osimport glob# 图像存储位置.*/input_dir = 'J:/project/images/'# 文件存放位置.*/out_dir = 'J:/project/output/'img_Lists = glob.glob(input_dir + '/*.jpg')img_basenames = []  # e.g. 100.jpgfor item in img_Lists:    img_basenames.append(os.path.basename(item))img_names = []  # e.g. 100for item in img_basenames:    temp1, temp2 = os.path.splitext(item)    img_names.append(temp1)a = os.listdir(input_dir)for i in a:    print(i)    I = Image.open(input_dir + i)    L = I.convert('L')    L.save(out_dir + i)

转载地址:http://fwdhz.baihongyu.com/

你可能感兴趣的文章
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(一)
查看>>
netty--helloword程序
查看>>
netty2---服务端和客户端
查看>>
【Flink】Flink 2023 Flink易用性和稳定性在Shopee的优化-视频笔记
查看>>
Netty5.x 和3.x、4.x的区别及注意事项(官方翻译)
查看>>
netty——bytebuf的创建、内存分配与池化、组成、扩容规则、写入读取、内存回收、零拷贝
查看>>
netty——Channl的常用方法、ChannelFuture、CloseFuture
查看>>
netty——EventLoop概念、处理普通任务定时任务、处理io事件、EventLoopGroup
查看>>
netty——Future和Promise的使用 线程间的通信
查看>>
netty——Handler和pipeline
查看>>
Vue输出HTML
查看>>
netty——黏包半包的解决方案、滑动窗口的概念
查看>>
Netty中Http客户端、服务端的编解码器
查看>>
Netty中使用WebSocket实现服务端与客户端的长连接通信发送消息
查看>>
Netty中实现多客户端连接与通信-以实现聊天室群聊功能为例(附代码下载)
查看>>
Netty中的组件是怎么交互的?
查看>>
Netty中集成Protobuf实现Java对象数据传递
查看>>
netty之 定长数据流处理数据粘包问题
查看>>
Netty事件注册机制深入解析
查看>>
netty代理
查看>>