Merge pull request #599 from gsenesac/senesac_pillow

Added in examples and link to tutorial for imaging.rst.
This commit is contained in:
Ian Cordasco
2015-10-20 12:51:36 -05:00
+29
View File
@@ -28,3 +28,32 @@ After that, it's straightforward:
.. code-block:: console
$ pip install Pillow
Example
~~~~~~~
.. code-block:: python
from PIL import Image, ImageFilter
#Read image
im = Image.open( 'image.jpg' )
#Display image
im.show()
#Applying a filter to the image
im_sharp = im.filter( ImageFilter.SHARPEN )
#Saving the filtered image to a new file
im_sharp.save( 'image_sharpened.jpg', 'JPEG' )
#Splitting the image into its respective bands, i.e. Red, Green,
#and Blue for RGB
r,g,b = im_sharp.split()
#Viewing EXIF data embedded in image
exif_data = im._getexif()
exif_data
There are more examples of the Pillow library
`here <http://pillow.readthedocs.org/en/3.0.x/handbook/tutorial.html>`_.