__init__(self, data=None, url=None, filename=None, format=None, embed=None, width=None, height=None, retina=False, unconfined=False, metadata=None, alt=None)
When this object is returned by an input cell or passed to the display function, it will result in the image being displayed in the frontend.
The raw image data or a URL or filename to load the data from. This always results in embedded image data.
A URL to download the data from. If you specify :None:None:`url=`
, the image data will not be embedded unless you also specify :None:None:`embed=True`
.
Path to a local file to load the data from. Images from a file are always embedded.
The format of the image data (png/jpeg/jpg/gif). If a filename or URL is given for format will be inferred from the filename extension.
Should the image data be embedded using a data URI (True) or be loaded using an <img> tag. Set this to True if you want the image to be viewable later with no internet connection in the notebook.
Default is :None:None:`True`
, unless the keyword argument url
is set, then default value is :None:None:`False`
.
Note that QtConsole is not able to display images if :None:None:`embed`
is set to :None:None:`False`
Width in pixels to which to constrain the image in html
Height in pixels to which to constrain the image in html
Automatically set the width and height to half of the measured width and height. This only works for embedded images because it reads the width/height from image data. For non-embedded images, you can just set the desired display width and height directly.
Set unconfined=True to disable max-width confinement of the image.
Specify extra metadata to attach to the image.
Alternative text for the image, for use by screen readers.
Create a PNG/JPEG/GIF image object given raw data.
embedded image data, works in qtconsole and notebook when passed positionally, the first arg can be any of raw image data, a URL, or a filename from which to load image data. The result is always embedding image data for inline images.
>>> Image('https://www.google.fr/images/srpr/logo3w.png') # doctest: +SKIP <IPython.core.display.Image object>
>>> Image('/path/to/image.jpg') <IPython.core.display.Image object>
>>> Image(b'RAW_PNG_DATA...') <IPython.core.display.Image object>
Specifying Image(url=...) does not embed the image data, it only generates <img>
tag with a link to the source. This will not work in the qtconsole or offline.
>>> Image(url='https://www.google.fr/images/srpr/logo3w.png') <IPython.core.display.Image object>See :
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them