PIL installation and use

Introduction to PIL

Image processing is a very widely used technology, and Python, which has a very rich third-party extension library, will certainly not miss this feast. PIL (Python Imaging Library) is the most commonly used image processing library in Python, the current version is 1.1.7, refer to the official information http://effbot.org/imagingbook/

The Image class is a very important class in the PIL library. To create an instance through this class, you can directly load the image file, read the processed image, and obtain the image through the grab method.

Note that PIL is not compatible with pillow.

Install

The methods of installing PIL under window7 and CenOS7 are different, the following methods are for reference only

CentOS7

  1. Dependency library installation:yum install -y python-devel libjpeg libjpeg-devel zlib zlib-devel freetype freetype-devel lcms lcms-devel
  2. Download the latest PIL package:wget http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
  3. Manual installation:

    tar zxvf Imaging-1.1.17.tar.gz
    cd Imaging-1.1.7/
    python python setup.py install

window7 64bit

Pillow is divided into 32bit and 64bit. For specific installation, please refer to the official information https://pillow.readthedocs.org/en/latest/installation.html , or manually download https://pypi.python.org/pypi/Pillow , Pillow -3.1.1-cp27-none-win_amd64.whl, then install manuallypip install Pillow-3.1.1-cp27-none-win_amd64.whl

Or download the corresponding installation package from a third-party website: http://www.lfd.uci.edu/~gohlke/pythonlibs/

refer to:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325656577&siteId=291194637