The recent project uses Python to process the output file, need to use the image module to deal with the picture, the default installed Python is not with the image Library, installation PiL Image Library is very simple, share the ~
If JPEG and zlib support is required first install the appropriate package
First, download the source package
http://www.pythonware.com/products/pil/index.htm Download the latest version of PIL installer, I downloaded the tar xfz imaging-1.1.7.tar.gz
Http://www.ijg.org The latest version is jpegsrc.v8b.tar.gz, install the JPEG library
http://www.gzip.org/zlib/Download zlib-1.2.5.tar.gz zlib library with compression enabled
Use the Python image processing library pil (Python image libraries) to convert the type of picture, modify the picture size, color value, transparency, and so on. There is also a special feature that can combine 2 pictures into 1 pictures. Specific features can refer to PiL's official documentation
The latest version is jpegsrc.v9.tar.gz, install the JPEG library
The code is as follows |
Copy Code |
TAR-ZXF jpegsrc.v9.tar.gz CD JPEGSRC.V9 ./configure && make && make test && make install
zlib:http://www.gzip.org/zlib/ |
Download the zlib-1.2.8.tar.gz zlib library that supports compression, install Zlib
The code is as follows |
Copy Code |
Tar Xfz zlib-1.2.8.tar.gz CD zlib-1.2.8 ./configure && make && make install
|
Now is the installation of Imagemok, download first: in http://www.pythonware.com/products/pil/index.htm download imaging-1.1.7.tar.gz
The code is as follows |
Copy Code |
Tar Xfz imaging-1.1.7.tar.gz CD Imaging-1.1.7 Python setup.py build_ext-i Python setup.py bulid sudo python setup.py install
|
This completes the installation, and the next step is to test:
Run Python, and then "import Image", if there is no error should be OK