Python批量修改图片分辨率的实例代码
作者:芋艿ashes 时间:2023-01-30 01:59:10
前言:处理图片需要,需把图片都转换成1920*1280的大小, python实现很方便,需要导入图片处理的Image包和匹配的glob包,很简单,代码如下:
img_path = glob.glob("D:/chosed/*.jpg")
path_save = "D:/closedd"
for file in img_path:
name = os.path.join(path_save, file)
im = Image.open(file)
im.thumbnail((1920,1280))
print(im.format, im.size, im.mode)
im.save(name,'JPEG')
来源:https://blog.csdn.net/u014257192/article/details/79187205
标签:Python,图片,分辨率
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Vue数据双向绑定原理及简单实现方法
2024-05-09 15:13:11
![](https://img.aspxhome.com/file/2023/9/126549_0s.png)
Python的时间模块datetime详解
2023-10-17 01:36:48
Thinkphp3.2.3反序列化漏洞实例分析
2023-06-14 11:27:37
![](https://img.aspxhome.com/file/2023/4/55514_0s.jpg)
python和pygame实现简单俄罗斯方块游戏
2022-10-04 20:00:49
![](https://img.aspxhome.com/file/2023/2/69532_0s.gif)
python DataFrame中stack()方法、unstack()方法和pivot()方法浅析
2023-12-13 17:38:55
![](https://img.aspxhome.com/file/2023/3/124223_0s.png)
Django商城项目注册功能的实现
2022-01-19 05:22:36
简单谈谈CommonsChunkPlugin抽取公共模块
2024-04-19 10:14:27
![](https://img.aspxhome.com/file/2023/8/135878_0s.png)
django站点管理详解
2022-03-31 00:16:43
python如何实现数组元素两两相加
2023-02-21 04:39:46
oracle表空间表分区详解及oracle表分区查询使用方法
2024-01-14 19:42:14
matplotlib给子图添加图例的方法
2023-05-02 03:21:28
![](https://img.aspxhome.com/file/2023/0/65460_0s.jpg)
基于idea操作hbase数据库并映射到hive表
2024-01-19 23:22:57
![](https://img.aspxhome.com/file/2023/7/110867_0s.png)
订单转化率之回访确认
2009-08-24 12:40:00
如何安装并使用conda指令管理python环境
2022-07-02 04:08:43
细说NumPy数组的四种乘法的使用
2023-08-16 10:33:28
![](https://img.aspxhome.com/file/2023/3/68413_0s.gif)
python函数返回多个值的示例方法
2023-04-14 10:38:05
tensorflow实现简单的卷积神经网络
2021-07-15 21:13:02
博客使用标签是迟早的事
2008-10-31 12:55:00
SQL Server数据库连接查询的种类及其应用
2009-01-06 11:28:00
Django通过自定义认证后端实现多种登录方式验证
2022-09-21 20:15:40