Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying an Image in the iPython qtconsole

Tags:

python

ipython

I'm trying to display an image in the ipython qtconsole via:

from IPython.display import Image
Image(filename='sky1024px.jpg')

But I get the following output

Out[6]: <IPython.core.display.Image object>

I installed python via Anaconda which has the needed library to display images. I tried searching stackoverflow and couldn't find any answers yet.

The version of python i'm running is:

  IPython QtConsole 3.2.0
  Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, May 28 2015, 17:04:42) 

The reason I want to get this working is I'm messing around with the google deepdream project which looks pretty fun and crazy. See: https://github.com/google/deepdream/blob/master/dream.ipynb

Sorry if this is simple question never used python and i'm been banging my head on this for a few hours!

Thanks!

like image 835
Gerb Avatar asked Jul 05 '15 22:07

Gerb


People also ask

Which method is used to display image in the Jupyter?

To display the image, the Ipython. display() method necessitates the use of a function. In the notebook, you can also specify the width and height of the image.

What is IPython Qtconsole?

The Qtconsole is a very lightweight application that largely feels like a terminal, but provides a number of enhancements only possible in a GUI, such as inline figures, proper multiline editing with syntax highlighting, graphical calltips, and more.


1 Answers

I found after I'd used display once Images were rendered:

from IPython.core.display import Image, display
display(Image('https://upload.wikimedia.org/wikipedia/commons/2/2a/Svm_max_sep_hyperplane_with_margin.png'))
like image 177
Alex Moore-Niemi Avatar answered Oct 19 '22 15:10

Alex Moore-Niemi