On this page

JPG#

Download this notebook from GitHub (right-click to download).


import panel as pn

pn.extension()

The JPG pane embeds a .jpg or .jpeg image file in a panel if provided a local path, or it will link to a remote image if provided a URL.

Parameters:#

For layout and styling related parameters see the customization user guide.

  • alt_text (str, default=None): alt text to add to the image tag. The alt text is shown when a user cannot load or display the image.

  • embed (boolean, default=False): If given a URL to an image this determines whether the image will be embedded as base64 or merely linked to.

  • link_url (str, default=None): A link URL to make the image clickable and link to some other website.

  • object (str or object): The JPEG file to display. Can be a string pointing to a local or remote file, or an object with a _repr_jpg_ method.

  • style (dict): Dictionary specifying CSS styles


The JPG pane can be pointed at any local or remote .jpg file. If given a URL starting with http or https, the embed parameter determines whether the image will be embedded or linked to:

jpg_pane = pn.pane.JPG('https://www.gstatic.com/webp/gallery/4.sm.jpg', width=500)

jpg_pane

Like any other pane, the JPG pane can be updated by setting the object parameter:

jpg_pane.object = 'https://www.gstatic.com/webp/gallery/1.sm.jpg'
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).