Image not able to show in Google colab using PIL library

Viewed 762
from PIL import Image 
visa_file='/content/visa-logo-mastercard.jpg'
img_visa= Image.open(visa_file,mode='r')
img_visa.show()

I am not getting the output of the image in Google colab.

Also the output of type(img_visa) is 'PIL.JpegImagePlugin.JpegImageFile'.

So the image object has been created, but the image is not displaying. And I only want to use PIL to show Image. How to do this?

1 Answers

Just

img_visa

is enough. You don't need

img_visa.show()

To be more explicit, you can use

display(img_visa)
Related