diff --git a/docs/scenarios/imaging.rst b/docs/scenarios/imaging.rst index f0f18bd..421793a 100644 --- a/docs/scenarios/imaging.rst +++ b/docs/scenarios/imaging.rst @@ -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 `_. + +