Display an image with Python

前端 未结 9 1643
后悔当初
后悔当初 2020-12-23 00:21

I tried to use IPython.display with the following code:

from IPython.display import display, Image
display(Image(filename=\'MyImage.png\'))

9条回答
  •  猫巷女王i
    2020-12-23 00:48

    import IPython.display as display
    from PIL import Image
    image_path = 'my_image.jpg'
    display.display(Image.open(image_path))
    

提交回复
热议问题