from io import BytesIO import base64 import streamlit as st def show_image_with_scroll( image, caption="", viewport_width=800, viewport_height=1200, zoom=1.0 ): buf = BytesIO() image.save(buf, format="PNG") img_base64 = base64.b64encode(buf.getvalue()).decode("utf-8") width = image.width height = image.height html = f"""
""" st.markdown(html, unsafe_allow_html=True) if caption: st.caption(caption)