GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.runoob.com — Pillow 教程 | 菜鸟教程
Pillow 教程
Pillow 教程
Pillow 简介
Pillow 安装
Pillow 入门实例
Pillow 图像基本操作
Pillow 绘图中文乱码
Pillow 常用模块与方法
Pillow 高级图像处理
Java Pillow 模块Pillow Image 模块 Pillow ImageDraw 模块 Pillow ImageFont 模块 Pillow ImageFilter 模块 Pillow ImageEnhance 模块 Pillow ImageOps 模块 Pillow ImageChops 模块 Pillow ImageColor 模块 Pillow ImageGrab 模块 Pillow ImageStat 模块 Pillow ImagePalette 模块 Pillow ImagePath 模块 ImageSequence 模块 Pillow ImageMorph 模块 Pillow ImageShow 模块 Pillow ImageTk 模块 Pillow ImageQt 模块 Pillow ExifTags 模块 Pillow PSDraw 模块 Pillow TiffTags 模块Pillow 教程
Pillow 是 Python 中处理图像的主要库。 Pillow 是 Python Imaging Library (PIL) 的一个友好分支。 由于原始的 PIL 已经不再维护,Pillow 接替了它的角色并继续活跃开发。 Pillow 提供了广泛的文件格式支持、高效的内部表示以及强大的图像处理功能。 谁适合阅读本教程?本教程适合有 Python 基础的开发者学习。 如果您还不了解 Python,可以先学习 Python 教程。 主要特点
与其他库的比较
第一个 Pillow 实例安装 Pillow 后,仍然使用 import PIL 或 from PIL import ... 来导入模块。 以下实例显示了图片的基本信息: 实例
from PIL import Image # 打开一张图片 img = Image.open("example.jpeg") # 显示图片 img.show() # 获取图片信息 print("图片格式:", img.format) # JPEG, PNG, etc. print("图片大小:", img.size) # (width, height) print("图片模式:", img.mode) # RGB, L, etc. # 保存为 PNG 格式 img.save("example.png") 运行结果: 图片格式: JPEG 图片大小: (987, 987) 图片模式: RGB 运行后,图片还会保存为 example.png。 相关内容
AI 思考中...
点我分享笔记取消
分类导航
Advertisement
|
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |