Streamlit component that allows you to create button to paste image from clipboard.
Project description
streamlit-custom-component
Streamlit component that allows you to create button to paste image from clipboard.
Installation instructions
pip install st_img_pastebutton
Usage instructions
import streamlit as st
from st_img_pastebutton import paste
from io import BytesIO
import base64
st.header("Image Clipboard Example")
st.write("Click the button below to upload an image from your clipboard.")
image_data = paste(key="image_clipboard")
if image_data is not None:
header, encoded = image_data.split(",", 1)
binary_data = base64.b64decode(encoded)
bytes_data = BytesIO(binary_data)
st.image(bytes_data, caption="Uploaded Image", use_column_width=True)
else:
st.write("No image uploaded yet.")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
st_img_pastebutton-0.0.2.tar.gz
(423.8 kB
view hashes)
Built Distribution
Close
Hashes for st_img_pastebutton-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b3b97db33d9145fa152971a9dd08ad5b4c7618909a59732bfbd9bc3ccd0ee3d |
|
MD5 | fca4e0bc79d8470b0b6b902e1a884933 |
|
BLAKE2b-256 | 9ee774a2a527bf711937080eb29f767ede4820f533a730a9f96f7059c8a6d68d |