Socket
Socket
Sign inDemoInstall

streamlit-image-viewer

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    streamlit-image-viewer

streamlit components for image viewer


Maintainers
1

Readme

Streamlit Image Viewer

Streamlit component for image viewer.

Python TypeScript

PyPI Streamlit App

<img src=demo/demo.gif>

Features

  • You can easily view the images in a folder side by side
  • Support for displaying images in multiple rows and columns

Install

pip install streamlit-image-viewer

Example Usage

from glob import glob
from streamlit_image_viewer import image_viewer
import streamlit as st

st.title("ImageViewer App")
st.title("Sample Images")
image_path_list = glob('../../image/*.jpg') + glob('../../image/*.png') 
image_viewer(image_path_list, ncol=3, nrow=2, key="image_viewer")

Example App

cd streamlit_image_viewer/ImageViewer
streamlit run app.py

API

image_viewer(
    image_path_list: List[str],
    ncol: int = 2,
    nrow: int = 2,
    image_name_visible: bool = True
    key: Optional[str] = None
)
  • image_path_list : A list containing paths to the images to be displayed.
  • ncol : The number of columns. Defaults to 2.
  • nrow : The number of rows. Defaults to 2.
  • image_name_visible : A boolean indicating whether image names are visible.
  • key : A unique key for the component. Can be used to distinguish between different components.

NOTE

  • ncol and nrow should be positive integers; otherwise, a ValueError will be raised.
    This function allows for the effective display of specified images in a grid layout with a customizable number of columns and rows. By default, a 2x2 grid is created, but you can adjust the column and row counts to suit your needs.

References

Release note

  • 2023/10/19 Release version 0.2.5 Now available for Multi-Page
  • 2023/9/22 Release version 0.2.2 Add Modal Image and image name visible/invisible
  • 2023/9/22 Release version 0.1.9
  • 2023/9/20 Release version 0.1.6

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc