# Streamlit Image Viewer
Streamlit component for image viewer.
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
[![PyPI](https://img.shields.io/pypi/v/streamlit-image-viewer)](https://pypi.org/project/streamlit-image-viewer/)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://st-image-annotation.streamlit.app/)
<img src=demo/demo.gif></img>
# Features
* You can easily view the images in a folder side by side
* Support for displaying images in multiple rows and columns
# Install
```sh
pip install streamlit-image-viewer
```
# Example Usage
```python
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
```shell
cd streamlit_image_viewer/ImageViewer
streamlit run app.py
```
# API
```python
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
* [**Streamlit-Image-Annotation**](https://github.com/hirune924/Streamlit-Image-Annotation/tree/master)
* [**Streamlit Components Doc**](https://docs.streamlit.io/library/components)
* [**streamlit-template**](https://github.com/streamlit/component-template)
* Sample Images are downloaded from [**Pixabay**](https://pixabay.com/ja/)
# 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
Raw data
{
"_id": null,
"home_page": "https://github.com/TakedaKatsuji/Streamlit-ImageViewer",
"name": "streamlit-image-viewer",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "Python,Streamlit,React,TypeScript",
"author": "katsuji takeda",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/90/a9/d6c166b0d306c272da4a78eb9ce204c5ff50a3f0905b327b38871e23fbe4/streamlit_image_viewer-0.2.5.tar.gz",
"platform": null,
"description": "# Streamlit Image Viewer\n\nStreamlit component for image viewer.\n\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)\n![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)\n\n[![PyPI](https://img.shields.io/pypi/v/streamlit-image-viewer)](https://pypi.org/project/streamlit-image-viewer/)\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://st-image-annotation.streamlit.app/)\n\n<img src=demo/demo.gif></img>\n# Features\n* You can easily view the images in a folder side by side\n* Support for displaying images in multiple rows and columns\n\n# Install\n```sh\npip install streamlit-image-viewer\n```\n\n# Example Usage\n```python\nfrom glob import glob\nfrom streamlit_image_viewer import image_viewer\nimport streamlit as st\n\nst.title(\"ImageViewer App\")\nst.title(\"Sample Images\")\nimage_path_list = glob('../../image/*.jpg') + glob('../../image/*.png') \nimage_viewer(image_path_list, ncol=3, nrow=2, key=\"image_viewer\")\n```\n# Example App\n```shell\ncd streamlit_image_viewer/ImageViewer\nstreamlit run app.py\n```\n# API\n```python\nimage_viewer(\n image_path_list: List[str],\n ncol: int = 2,\n nrow: int = 2,\n image_name_visible: bool = True\n key: Optional[str] = None\n)\n```\n* **image_path_list** : A list containing paths to the images to be displayed.\n* **ncol** : The number of columns. Defaults to 2.\n* **nrow** : The number of rows. Defaults to 2.\n* **image_name_visible** : A boolean indicating whether image names are visible.\n* **key** : A unique key for the component. Can be used to distinguish between different components.\n\n## NOTE\n* `ncol` and `nrow` should be positive integers; otherwise, a ValueError will be raised. \nThis 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.\n\n# References\n\n* [**Streamlit-Image-Annotation**](https://github.com/hirune924/Streamlit-Image-Annotation/tree/master) \n* [**Streamlit Components Doc**](https://docs.streamlit.io/library/components) \n* [**streamlit-template**](https://github.com/streamlit/component-template) \n* Sample Images are downloaded from [**Pixabay**](https://pixabay.com/ja/)\n\n# Release note\n* 2023/10/19 Release version 0.2.5 Now available for Multi-Page\n* 2023/9/22 Release version 0.2.2 Add Modal Image and image name visible/invisible\n* 2023/9/22 Release version 0.1.9\n* 2023/9/20 Release version 0.1.6\n",
"bugtrack_url": null,
"license": "",
"summary": "streamlit components for image viewer",
"version": "0.2.5",
"project_urls": {
"Homepage": "https://github.com/TakedaKatsuji/Streamlit-ImageViewer"
},
"split_keywords": [
"python",
"streamlit",
"react",
"typescript"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "81dce1d8aa968d0a61ec4605a6e6c1e971e9eba82c2cc06827b0ec8bad358922",
"md5": "d92a275546de544c05a3fe13808553f0",
"sha256": "b3c893706bb021c57b7130a336ad87face894f4a470bf583008ea2b2741b9ca2"
},
"downloads": -1,
"filename": "streamlit_image_viewer-0.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d92a275546de544c05a3fe13808553f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1288669,
"upload_time": "2023-10-19T05:24:22",
"upload_time_iso_8601": "2023-10-19T05:24:22.811696Z",
"url": "https://files.pythonhosted.org/packages/81/dc/e1d8aa968d0a61ec4605a6e6c1e971e9eba82c2cc06827b0ec8bad358922/streamlit_image_viewer-0.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "90a9d6c166b0d306c272da4a78eb9ce204c5ff50a3f0905b327b38871e23fbe4",
"md5": "8153cbd770b1867f21fa7bf89e27b36b",
"sha256": "9f45a30bce582f6f45ecd9fa75f70adc533cce8b17eff93c374810ec9bf8ef96"
},
"downloads": -1,
"filename": "streamlit_image_viewer-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "8153cbd770b1867f21fa7bf89e27b36b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1276880,
"upload_time": "2023-10-19T05:24:25",
"upload_time_iso_8601": "2023-10-19T05:24:25.159480Z",
"url": "https://files.pythonhosted.org/packages/90/a9/d6c166b0d306c272da4a78eb9ce204c5ff50a3f0905b327b38871e23fbe4/streamlit_image_viewer-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-19 05:24:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TakedaKatsuji",
"github_project": "Streamlit-ImageViewer",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "streamlit",
"specs": [
[
"==",
"1.24"
]
]
},
{
"name": "Pillow",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "streamlit-image-viewer",
"specs": []
}
],
"lcname": "streamlit-image-viewer"
}