I tried to use IPython.display with the following code:
from IPython.display import display, Image
display(Image(filename='MyImage.png'))
I also tried to use matplotlib with the following code:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
plt.imshow(mpimg.imread('MyImage.png'))
In both cases, nothing is displayed, not even an error message.
Using opencv-python is faster for more operation on image:
It's simple Use following pseudo code
plt.show()
// this will show you the image on console.If you use
matplotlib
, you need to show the image usingplt.show()
unless you are not in interactive mode. E.g.:If you are using matplotlib and want to show the image in your interactive notebook, try the following:
In a much simpler way you can do the same using
This worked for me, Inspired by @the_unknown_spirit