Skip to content

Commit c97204d

Browse files
committed
Merge pull request #599 from gsenesac/senesac_pillow
Added in examples and link to tutorial for imaging.rst.
2 parents f000b2b + 2b12a3c commit c97204d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/scenarios/imaging.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,32 @@ After that, it's straightforward:
2828
.. code-block:: console
2929
3030
$ pip install Pillow
31+
32+
Example
33+
~~~~~~~
34+
35+
.. code-block:: python
36+
37+
from PIL import Image, ImageFilter
38+
#Read image
39+
im = Image.open( 'image.jpg' )
40+
#Display image
41+
im.show()
42+
43+
#Applying a filter to the image
44+
im_sharp = im.filter( ImageFilter.SHARPEN )
45+
#Saving the filtered image to a new file
46+
im_sharp.save( 'image_sharpened.jpg', 'JPEG' )
47+
48+
#Splitting the image into its respective bands, i.e. Red, Green,
49+
#and Blue for RGB
50+
r,g,b = im_sharp.split()
51+
52+
#Viewing EXIF data embedded in image
53+
exif_data = im._getexif()
54+
exif_data
55+
56+
There are more examples of the Pillow library
57+
`here <http://pillow.readthedocs.org/en/3.0.x/handbook/tutorial.html>`_.
58+
59+

0 commit comments

Comments
 (0)