概述¶
Python Imaging Library 增加了图像处理功能,您的Python解释器.
该库提供了广泛的文件格式支持,一个高效的内部表示,以及相当强大的图像处理能力.
核心图像库是专为快速访问存储在几个基本的像素格式的数据. 它应该提供一个一般的图像处理工具了坚实的基础.
让我们看看这个库的几个可能的用途.
图片档案¶
Python图像库是理想的图像归档和批处理应用程序. 您可以使用库创建缩略图,文件格式,打印图像等之间转换
The current version identifies and reads a large number of formats. Write support is intentionally restricted to the most commonly used interchange and presentation formats.
图像显示¶
The current release includes Tk PhotoImage
and
BitmapImage
interfaces, as well as a Windows
DIB interface
that can be used with PythonWin and other
Windows-based toolkits. Many other GUI toolkits come with some kind of PIL
support.
出于调试,还有一个:PY:甲基:`〜PIL.Image.Image.show`方法,其保存图像到磁盘,并且调用外部显示效用.
图像处理¶
The library contains basic image processing functionality, including point operations, filtering with a set of built-in convolution kernels, and colour space conversions.
该库还支持图像缩放,旋转和任意仿射变换.
There’s a histogram method allowing you to pull some statistics out of an image. This can be used for automatic contrast enhancement, and for global statistical analysis.