Toggle navigation
  • 首页
  • 所有教程
  • 导航
  • Python
  • 人工智能
  • JAVA
  • 数据库
  • 前端
  • linux
  • 大数据
  • 技术文章
  • 更多
    • C/C++
    • 软件
    • 大杂烩
    • 硬件

matplotlib读写图片和numpy

作者:马育民 • 2019-12-10 13:33 • 阅读:10088

读取图片返回numpy

import matplotlib

arr=matplotlib.image.imread("8.jpg")
arr.shape

将numpy写成图片

import matplotlib

matplotlib.image.imsave("8.jpg",arr,cmap="gray")
参数
  • cmap:gray表示灰度图

原文出处:/show_1EF4aPIrHVXj.html

python

搜索

相关文章

python-calamine:rust实现的读取excel高性能库
python tkinter在 Windows高分屏下,窗口模糊不清晰
uv教程:基于 requirements.txt 安装依赖、导出依赖
SQLAlchemy教程:第一个例子-4.实现保存数据
SQLAlchemy教程:expire_on_commit不要设置为True
SQLAlchemy教程:创建session
FastAPI教程-集成SQLAlchemy:expire_on_commit不要设置为True
FastAPI教程-集成SQLAlchemy:在路由中执行添加数据
FastAPI教程-集成SQLAlchemy:在路由中执行查询
FastAPI教程-集成SQLAlchemy:封装表增删改查的操作文件
吉ICP备15003043号