Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image.show() doesn't display image

I am trying to display an image on VScode using Image.show from the pillow library but it doesn't work.

This is the code:

from PIL import Image

im = Image.open("/workspaces/105456256/project/before2.jpg")
im.show()

when I run this I don't get any error, instead, nothing happens. My OS is Windows 11. I tried the same code on PyCharm and it worked just fine.

like image 660
thaPapaya Avatar asked Jun 02 '26 04:06

thaPapaya


1 Answers

Try using:

from PIL import Image

im = Image.open("/workspaces/105456256/project/before2.jpg")
im.show()

input("Press ENTER to exit") # pause
like image 143
kaliiiiiiiii Avatar answered Jun 05 '26 01:06

kaliiiiiiiii



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!