Pillow的学习笔记
发布时间
阅读量:
阅读量
Tutorial
本文笔记起源于Pillow官网文档Pillow官方文档。仅限于个人学习使用。

Using the Image class
PIL的核心类 Image
open加载图像 loading images from files
im = Image.open('file path & file name')
Image的属性
| 属性 | 值 |
|---|---|
| im.format | 图像的来源 |
| im.size | tuple (width,height) pixels |
| im.mode | L灰度值,RGB,CMYK |
该方法运行效率不高。主要原因是该函数运行时会临时保存文件,并依赖于另一个名为xy的工具来呈现图像。
Reading and writing images
PIL支持很多图像格式,open()函数会自动判断图像格式,不用操心
Image类的save()方法用于存储图像数据
全部评论 (0)
还没有任何评论哟~
