Syntax error Loading and displaying an image using the Pillow library

Loading and displaying an image using the Pillow library



In this program, we will read or load an image using the pillow library. The pillow library consists of a method called Image.open(). This function takes the file path or the name of the file as a string. To display the image, we use another function show(). It does not require any parameter.

Example Code

from PIL import Image

im = Image.open('testimage.jpg')
im.show()

Output

Updated on: 2021-03-17T08:46:35+05:30

216 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements