Skip to main content

streamlit components for image viewer

Project description

Streamlit Image Viewer

Streamlit component for image viewer.

Python TypeScript

PyPI Streamlit App

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_image_viewer-0.2.5.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_image_viewer-0.2.5-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file streamlit_image_viewer-0.2.5.tar.gz.

File metadata

  • Download URL: streamlit_image_viewer-0.2.5.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for streamlit_image_viewer-0.2.5.tar.gz
Algorithm Hash digest
SHA256 9f45a30bce582f6f45ecd9fa75f70adc533cce8b17eff93c374810ec9bf8ef96
MD5 8153cbd770b1867f21fa7bf89e27b36b
BLAKE2b-256 90a9d6c166b0d306c272da4a78eb9ce204c5ff50a3f0905b327b38871e23fbe4

See more details on using hashes here.

File details

Details for the file streamlit_image_viewer-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_image_viewer-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b3c893706bb021c57b7130a336ad87face894f4a470bf583008ea2b2741b9ca2
MD5 d92a275546de544c05a3fe13808553f0
BLAKE2b-256 81dce1d8aa968d0a61ec4605a6e6c1e971e9eba82c2cc06827b0ec8bad358922

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page