ImageViewer

class ibb.widgets.ImageViewer(**kwargs: Any)[source]

This widget is a basic image browser.

Parameters
  • images (list-like) – This list-like (iterable with len) should contain your images (See Note below)

  • lambda_image (function, optional) – This function gets the value from the images and should return a numpy array that is readable by the ImageCanvas; Default See Note

  • **kwargs (dict) – Extra keyword arguments that can be passed to Viewer

Note

The default lambda_image function can work with 2 types of data:

  • String/Path: If the images contain strings/Path-objects, it will consider them as paths to images and try to read them.

  • Other: If it is anything else it will pass the data to the ImageCanvas as follows: np.asaray(<DATA>)

Examples

Warning

Note that the widgets are not responding as we do not have a python backend running!

[1]:
from pathlib import Path
import ipywidgets
import ibb
[2]:
ibb.ImageViewer(
    images=list(Path('images/').iterdir()),
)
[2]: