python - 我试图在 python 中使用枕头模块打开图像
问题描述
from PIL import Image
image1 = Image.open('img1.jpg', "rb")
image1.show()
使用这个命令
我收到以下错误,我尝试使用 rb 之类的打开模式打开,但它引发了错误模式的值错误
Traceback (most recent call last):
File "C:\Users\Gowtham\Desktop\Quarantine python\Image manipulation\img.py", line 3, in <module>
image1 = Image.open('img1.jpg',"rb")
File "C:\Users\Gowtham\Anaconda3\lib\site-packages\PIL\Image.py", line 2599, in open
raise ValueError("bad mode %r" % mode)
ValueError: bad mode 'rb'
[Finished in 1.047s]
解决方案
推荐阅读
- sql - 在 postgreSQL 中提供路由的递归查询
- charts - 是否可以在不累加系列的情况下使用堆积柱形图?
- javascript - 将键值对从数组添加到 javascript 对象的问题
- php - 我无法在 fancybox-3 上预览缩略图
- c++ - 枚举类的 C 样式转换为底层类型 char 的引用
- javascript - 将待办事项发布到我的数据库 - 它适用于 Postman
- javascript - 如何在php中嵌套双引号
- c# - VS2019 试图加载一个不再存在的 dll
- c# - 有没有办法在迭代期间编辑字典的值?
- python - 将 for 循环过滤器的结果保存到新的 csv