Skip to content

Instantly share code, notes, and snippets.

@parente parente/README.md
Last active Nov 12, 2019

Embed
What would you like to do?
Jupyter Tidbit: Display an image gallery

Summary

JupyterLab and Jupyter Notebook can display HTML-embedded images in notebook documents. You can use the IPython.display.HTML class to structure these images into a basic image gallery.

Example

Binder

The notebook below defines a gallery() function that accepts a list of image URLs, local image file paths, or bytes in memory. The function displays the images from left-to-right, top-to-bottom in the notebook. An optional max_height parameter scales all images to the same height to create more regular looking rows.

The notebook includes two demos of the function output.

Why is this useful?

You may find a gallery view useful when you need to visually scan a large set of images. The horizontal layout helps reduce notebook scrolling. The fixed height option lets you pack more images on the screen at once and spot coarse differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.